Skip to content

Commit

Permalink
Merge pull request #380 from NiclasvanEyk/feature/add-pail
Browse files Browse the repository at this point in the history
Feature/add pail
  • Loading branch information
NiclasvanEyk authored Dec 8, 2023
2 parents 15f9708 + 8257ed6 commit c3b2873
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function rules(): array
/** @see DevelopmentTools */
P::USES_TELESCOPE => ['sometimes'],
P::USES_ENVOY => ['sometimes'],
P::USES_PAIL => ['sometimes'],

/** @see Testing */
P::USES_DUSK => ['sometimes'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function buildForm(): CreateProjectForm
usesTelescope: $this->has(P::USES_TELESCOPE),
usesEnvoy: $this->has(P::USES_ENVOY),
usesPennant: $this->has(P::USES_PENNANT),
usesPail: $this->has(P::USES_PAIL),
usesDevcontainer: $this->has(P::USES_DEVCONTAINER),
),
testing: new Testing(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CreateProjectRequestParameter
const USES_TELESCOPE = self::USES_PREFIX.'telescope';
const USES_MAILHOG = self::USES_PREFIX.'mailhog';
const USES_ENVOY = self::USES_PREFIX.'envoy';
const USES_PAIL = self::USES_PREFIX.'pail';
const USES_PENNANT = self::USES_PREFIX.'pennant';
const USES_DEVCONTAINER = self::USES_PREFIX.'devcontainer';

Expand Down
1 change: 1 addition & 0 deletions domains/CreateProjectForm/Sections/DevelopmentTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public function __construct(
public bool $usesEnvoy,
public bool $usesPennant,
public bool $usesDevcontainer,
public bool $usesPail,
) {
}
}
1 change: 1 addition & 0 deletions domains/CreateProjectForm/Sections/Metadata/PhpVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class PhpVersion

public const v8_1 = '8.1';
public const v8_2 = '8.2';
public const v8_3 = '8.3';

public static function latest(): string
{
Expand Down
2 changes: 1 addition & 1 deletion domains/DockerImages/Console/Commands/UpdateSailImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function handle(): int

foreach (File::directories($runtimesPath) as $runtimePath) {
$runtime = basename($runtimePath);
if (in_array($runtime, ['7.4'])) {
if (in_array($runtime, ['7.4', '8.0'])) {
$this->info("Skipping '$runtime'...");
continue;
}
Expand Down
15 changes: 15 additions & 0 deletions domains/Laravel/ComposerPackages/Packages/Pail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Domains\Laravel\ComposerPackages\Packages;

use Domains\Laravel\ComposerPackages\FirstPartyPackage;

class Pail extends FirstPartyPackage
{
const REPOSITORY_KEY = 'pail';

public function description(): string
{
return "Dive into your Laravel application's log files directly from the console.";
}
}
2 changes: 1 addition & 1 deletion domains/PostDownload/PostDownloadTaskGroupCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ private function hasFrontend(CreateProjectForm $form): bool
$usesBreezeApiStack = $starterKit instanceof Breeze
&& $starterKit->frontend->name === BreezeFrontend::API;

return !$usesBreezeApiStack;
return ! $usesBreezeApiStack;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Domains\Laravel\ComposerPackages\Packages\Envoy;
use Domains\Laravel\ComposerPackages\Packages\Fortify;
use Domains\Laravel\ComposerPackages\Packages\Horizon;
use Domains\Laravel\ComposerPackages\Packages\Pail;
use Domains\Laravel\ComposerPackages\Packages\Passport;
use Domains\Laravel\ComposerPackages\Packages\Pennant;
use Domains\Laravel\ComposerPackages\Packages\Scout;
Expand Down Expand Up @@ -185,6 +186,10 @@ public function forDevelopmentTools(
$packages[] = new Pennant();
}

if ($developmentTools->usesPail) {
$packages[] = new Pail();
}

return $packages;
}

Expand Down
47 changes: 25 additions & 22 deletions resources/views/partials/form-section/dev-tools.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
@php
use Domains\CreateProjectForm\Http\Request\CreateProjectRequest\CreateProjectRequestParameter as P;
use Domains\Laravel\ComposerPackages\Packages;
$telescope = new Packages\Telescope();
$telescopeParameter = P::USES_TELESCOPE;
$usesTelescope = checkbox_checked($telescopeParameter);
$envoy = new Packages\Envoy();
$envoyParameter = P::USES_ENVOY;
$usesEnvoy = checkbox_checked($envoyParameter);
$pennant = new Packages\Pennant();
$pennantParameter = P::USES_PENNANT;
$usesPennant = checkbox_checked($pennantParameter);
$devcontainerParameter = P::USES_DEVCONTAINER;
$usesDevcontainer = checkbox_checked($devcontainerParameter);
use Domains\CreateProjectForm\Http\Request\CreateProjectRequest\CreateProjectRequestParameter as P;
use Domains\Laravel\ComposerPackages\Packages;
$telescope = new Packages\Telescope();
$telescopeParameter = P::USES_TELESCOPE;
$usesTelescope = checkbox_checked($telescopeParameter);
$envoy = new Packages\Envoy();
$envoyParameter = P::USES_ENVOY;
$usesEnvoy = checkbox_checked($envoyParameter);
$pennant = new Packages\Pennant();
$pennantParameter = P::USES_PENNANT;
$usesPennant = checkbox_checked($pennantParameter);
$pail = new Packages\Pail();
$pailParameter = P::USES_PAIL;
$usesPail = checkbox_checked($pailParameter);
$devcontainerParameter = P::USES_DEVCONTAINER;
$usesDevcontainer = checkbox_checked($devcontainerParameter);
@endphp

<x-form-section name="Development Tools">
Expand Down Expand Up @@ -44,10 +48,9 @@
<x-first-party-package.option :id="$telescopeParameter" :checked="$usesTelescope" :package="$telescope" />
<x-first-party-package.option :id="$envoyParameter" :checked="$usesEnvoy" :package="$envoy" />
<x-first-party-package.option :id="$pennantParameter" :checked="$usesPennant" :package="$pennant" />
<x-first-party-package.option :id="$pailParameter" :checked="$usesPail" :package="$pail" />

<x-form-control.checkbox :id="$devcontainerParameter" heading="Devcontainers"
href="https://code.visualstudio.com/docs/devcontainers/containers" :checked="$usesDevcontainer">
Enables your IDE to run <i class="text-italic">inside</i> your local development containers using the <x-link
href="https://containers.dev">Development Containers standard</x-link>.
<x-form-control.checkbox :id="$devcontainerParameter" heading="Devcontainers" href="https://code.visualstudio.com/docs/devcontainers/containers" :checked="$usesDevcontainer">
Enables your IDE to run <i class="text-italic">inside</i> your local development containers using the <x-link href="https://containers.dev">Development Containers standard</x-link>.
</x-form-control.checkbox>
</x-form-section>
</x-form-section>
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public static function metadata(): Metadata
return new Metadata(
vendorName: 'foo',
projectName: 'bar',
description: '', phpVersion: Metadata\PhpVersion::latest(),
description: '',
phpVersion: Metadata\PhpVersion::latest(),
);
}

Expand Down Expand Up @@ -159,6 +160,7 @@ public static function developmentTools(): DevelopmentTools
usesTelescope: true,
usesEnvoy: true,
usesPennant: true,
usesPail: true,
usesDevcontainer: true,
);
}
Expand Down

0 comments on commit c3b2873

Please sign in to comment.