Skip to content

Commit dcf7e38

Browse files
Fix styling
1 parent b7377df commit dcf7e38

22 files changed

+221
-204
lines changed

packages/monorepo/config/monorepo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@
7676
'ttl' => env('MONOREPO_CACHE_TTL', 300), // 5 minutes
7777
'prefix' => 'monorepo_v2',
7878
],
79-
];
79+
];

packages/monorepo/src/Actions/CreateReleaseAction.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use Illuminate\Support\Collection;
66
use Moox\Monorepo\Contracts\GitHubClientInterface;
77
use Moox\Monorepo\Contracts\VersionManagerInterface;
8-
use Moox\Monorepo\DataTransferObjects\ReleaseInfo;
98
use Moox\Monorepo\DataTransferObjects\PackageChange;
9+
use Moox\Monorepo\DataTransferObjects\ReleaseInfo;
1010

1111
class CreateReleaseAction
1212
{
@@ -37,15 +37,15 @@ public function createRelease(ReleaseInfo $releaseInfo): bool
3737
public function preparePackagesForWorkflow(Collection $packageChanges): array
3838
{
3939
$maxSize = config('monorepo.release.max_payload_size', 50000);
40-
40+
4141
// Convert package changes to workflow format
4242
$packages = $packageChanges->mapWithKeys(function (PackageChange $change) {
4343
return [
4444
$change->packageName => [
4545
'release-message' => [$change->getSanitizedReleaseMessage()],
4646
'change-type' => $change->changeType,
4747
'moox-stability' => $change->metadata['moox_stability'] ?? 'dev',
48-
]
48+
],
4949
];
5050
})->toArray();
5151

@@ -94,7 +94,7 @@ public function createMultipleReleases(Collection $releaseInfos): Collection
9494
{
9595
return $releaseInfos->map(function (ReleaseInfo $releaseInfo) {
9696
$success = $this->createRelease($releaseInfo);
97-
97+
9898
return $releaseInfo->withMetadata([
9999
'created' => $success,
100100
'created_at' => now()->toISOString(),
@@ -112,8 +112,8 @@ public function processCompleteRelease(
112112
): array {
113113
// Create the release
114114
$releaseCreated = $this->createRelease($releaseInfo);
115-
116-
if (!$releaseCreated) {
115+
116+
if (! $releaseCreated) {
117117
return [
118118
'success' => false,
119119
'error' => 'Failed to create release',
@@ -146,7 +146,7 @@ public function processCompleteRelease(
146146
private function truncatePackagesPayload(array $packages, int $maxSize): array
147147
{
148148
$truncated = [];
149-
149+
150150
foreach ($packages as $name => $data) {
151151
$truncated[$name] = [
152152
'release-message' => ['Release update'],
@@ -157,4 +157,4 @@ private function truncatePackagesPayload(array $packages, int $maxSize): array
157157

158158
return $truncated;
159159
}
160-
}
160+
}

packages/monorepo/src/Actions/DiscoverPackagesAction.php

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,37 @@ public function __construct(
2020
public function discoverPackages(string $path, string $visibility = 'public'): Collection
2121
{
2222
$organization = config('monorepo.github.organization');
23-
$repoName = $visibility === 'public'
23+
$repoName = $visibility === 'public'
2424
? config('monorepo.github.public_repo')
2525
: config('monorepo.github.private_repo');
2626

27-
if (!$repoName) {
27+
if (! $repoName) {
2828
return collect();
2929
}
3030

3131
// Get packages from GitHub monorepo
3232
$remotePackages = $this->githubClient->getMonorepoPackages($organization, $repoName, 'packages');
33-
33+
3434
if ($remotePackages->isEmpty()) {
3535
return collect();
3636
}
3737

3838
$localPath = base_path($path);
39-
39+
4040
return $remotePackages->map(function ($remotePackage) use ($localPath, $path, $visibility) {
4141
$packageName = $remotePackage['name'];
42-
$localPackagePath = $localPath . '/' . $packageName;
43-
42+
$localPackagePath = $localPath.'/'.$packageName;
43+
4444
// Ensure local directory exists
45-
if (!File::isDirectory($localPackagePath)) {
45+
if (! File::isDirectory($localPackagePath)) {
4646
$this->createLocalPackageDirectory($localPackagePath, $packageName);
4747
}
48-
48+
4949
// Create package info from remote data
5050
$composerData = $remotePackage['composer'] ?? [];
5151
$description = $composerData['description'] ?? null;
5252
$stability = $remotePackage['stability'] ?? 'dev';
53-
53+
5454
return new PackageInfo(
5555
name: $packageName,
5656
path: $path,
@@ -69,16 +69,15 @@ private function createLocalPackageDirectory(string $path, string $packageName):
6969
{
7070
try {
7171
File::makeDirectory($path, 0755, true);
72-
72+
7373
// Optionally create a basic README to indicate this was auto-created
74-
$readmePath = $path . '/README.md';
75-
if (!File::exists($readmePath)) {
74+
$readmePath = $path.'/README.md';
75+
if (! File::exists($readmePath)) {
7676
File::put($readmePath, "# {$packageName}\n\nAuto-created package directory for GitHub repository sync.\n");
7777
}
78-
7978
} catch (\Exception $e) {
8079
// Log error but don't fail the discovery process
81-
logger()->warning("Failed to create directory for package {$packageName}: " . $e->getMessage());
80+
logger()->warning("Failed to create directory for package {$packageName}: ".$e->getMessage());
8281
}
8382
}
8483

@@ -99,15 +98,15 @@ public function compareWithRemote(Collection $localPackages, string $organizatio
9998
public function getPackageInfo(string $packageName, string $path, string $visibility = 'public'): ?PackageInfo
10099
{
101100
$composerPath = base_path("{$path}/{$packageName}/composer.json");
102-
103-
if (!File::exists($composerPath)) {
101+
102+
if (! File::exists($composerPath)) {
104103
return null;
105104
}
106105

107106
try {
108107
$composer = json_decode(File::get($composerPath), true);
109-
110-
if (!$composer) {
108+
109+
if (! $composer) {
111110
return null;
112111
}
113112

@@ -124,4 +123,4 @@ public function existsInOrganization(string $packageName, string $organization):
124123
{
125124
return $this->githubClient->getRepository($organization, $packageName) !== null;
126125
}
127-
}
126+
}

packages/monorepo/src/Actions/ProcessChangelogAction.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
*/
2323
public function parseChangelog(string $changelogPath): Collection
2424
{
25-
if (!File::exists($changelogPath)) {
25+
if (! File::exists($changelogPath)) {
2626
return collect();
2727
}
2828

@@ -36,20 +36,21 @@ public function parseChangelog(string $changelogPath): Collection
3636
// Match package headers like "## PackageName"
3737
if (preg_match('/^##\s+(.*)$/', $line, $matches)) {
3838
$currentPackage = trim($matches[1]);
39-
if (!$changes->has(strtolower($currentPackage))) {
39+
if (! $changes->has(strtolower($currentPackage))) {
4040
$changes->put(strtolower($currentPackage), collect());
4141
}
42-
}
42+
}
4343
// Match change entries like "- Some change"
4444
elseif ($currentPackage && preg_match('/^-\s+(.*)$/', $line, $matches)) {
4545
$change = trim($matches[1]);
46-
if (!empty($change)) {
46+
if (! empty($change)) {
4747
$changes->get(strtolower($currentPackage))->push($change);
4848
}
4949
}
5050
}
5151

5252
$this->parsedChanges = $changes;
53+
5354
return $changes;
5455
}
5556

@@ -79,8 +80,8 @@ public function generateReleaseMessage(string $packageName, ?string $stability =
7980
};
8081
}
8182

82-
return $changes->count() === 1
83-
? $changes->first()
83+
return $changes->count() === 1
84+
? $changes->first()
8485
: $changes->implode('; ');
8586
}
8687

@@ -126,4 +127,4 @@ public function createPackageChange(string $packageName, string $stability, stri
126127
default => PackageChange::compatibility($packageName, $packageType)
127128
};
128129
}
129-
}
130+
}

0 commit comments

Comments
 (0)