Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Add default config for select starter kit modules #11045

Merged
merged 9 commits into from
Nov 26, 2024
Next Next commit
Spec out default config for select module types, when prompt: false.
  • Loading branch information
jesseleite committed Nov 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit fbd18e2d7720567a6be49cda2e8280e62d400cb7
60 changes: 58 additions & 2 deletions tests/StarterKits/InstallTest.php
Original file line number Diff line number Diff line change
@@ -780,7 +780,7 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run
],
'modules' => [
'seo' => [
'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed non-interactively
'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed
'export_paths' => [
'resources/css/seo.css',
],
@@ -797,11 +797,39 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run
],
],
'jamaica' => [
'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed non-interactively
'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed
'export_as' => [
'resources/css/theme.css' => 'resources/css/jamaica.css',
],
],
'js' => [
'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed
'default' => 'vue', // And a `default` is required so that we know which one to install
'options' => [
'react' => [
'label' => 'React JS',
'export_paths' => [
'resources/js/react.js',
],
],
'vue' => [
'label' => 'Vue JS',
'export_paths' => [
'resources/js/vue.js',
],
],
],
],
'js_invalid' => [
'prompt' => false, // Setting prompt to false without a `default`, is not valid config
'options' => [
'svelte' => [
'export_paths' => [
'resources/js/svelte.js',
],
],
],
],
],
]);

@@ -811,6 +839,9 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run
$this->assertFileDoesNotExist(base_path('resources/css/theme.css'));
$this->assertComposerJsonDoesntHave('statamic/seo-pro');
$this->assertComposerJsonDoesntHave('bobsled/speed-calculator');
$this->assertFileDoesNotExist(base_path('resources/js/react.js'));
$this->assertFileDoesNotExist(base_path('resources/js/vue.js'));
$this->assertFileDoesNotExist(base_path('resources/js/svelte.js'));

$this->installCoolRunnings();

@@ -820,6 +851,9 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run
$this->assertFileExists(base_path('resources/css/theme.css'));
$this->assertComposerJsonHasPackageVersion('require', 'statamic/seo-pro', '^0.2.0');
$this->assertComposerJsonDoesntHave('bobsled/speed-calculator');
$this->assertFileDoesNotExist(base_path('resources/js/react.js'));
$this->assertFileExists(base_path('resources/js/vue.js'));
$this->assertFileDoesNotExist(base_path('resources/js/svelte.js'));
}

#[Test]
@@ -1179,6 +1213,24 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w
'resources/dictionaries/canadian_players.yaml',
],
],
'js' => [
'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed
'default' => 'vue', // And a `default` is required so that we know which one to install
'options' => [
'react' => [
'label' => 'React JS',
'export_paths' => [
'resources/js/react.js',
],
],
'vue' => [
'label' => 'Vue JS',
'export_paths' => [
'resources/js/vue.js',
],
],
],
],
],
],
],
@@ -1192,6 +1244,8 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w
$this->assertFileDoesNotExist(base_path('resources/dictionaries/players.yaml'));
$this->assertFileDoesNotExist(base_path('resources/dictionaries/american_players.yaml'));
$this->assertFileDoesNotExist(base_path('resources/dictionaries/canadian_players.yaml'));
$this->assertFileDoesNotExist(base_path('resources/js/react.js'));
$this->assertFileDoesNotExist(base_path('resources/js/vue.js'));

$this->installCoolRunnings();

@@ -1201,6 +1255,8 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w
$this->assertFileExists(base_path('resources/dictionaries/players.yaml'));
$this->assertFileDoesNotExist(base_path('resources/dictionaries/american_players.yaml'));
$this->assertFileExists(base_path('resources/dictionaries/canadian_players.yaml'));
$this->assertFileDoesNotExist(base_path('resources/js/react.js'));
$this->assertFileExists(base_path('resources/js/vue.js'));
}

#[Test]
Loading
Oops, something went wrong.