Skip to content

Commit

Permalink
feat(monorepo-builder.php): add monorepo-builder.php file
Browse files Browse the repository at this point in the history
- Add monorepo-builder.php file
- Include necessary dependencies
- Set default branch to 'main'
- Define release workers
- Perform environment checks
  • Loading branch information
guanguans committed Aug 2, 2023
1 parent a70a653 commit 4198531
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 15 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
'lang',
'noinspection',
'var',
'see',
],
],

Expand Down
53 changes: 53 additions & 0 deletions monorepo-builder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

declare(strict_types=1);

/**
* This file is part of the guanguans/laravel-exception-notify.
*
* (c) guanguans <[email protected]>
*
* This source file is subject to the MIT license that is bundled.
*/

use Guanguans\MonorepoBuilderWorker\CreateGithubReleaseWorker;
use Guanguans\MonorepoBuilderWorker\GoUpdateChangelogReleaseWorker;
use Guanguans\MonorepoBuilderWorker\NodeUpdateChangelogReleaseWorker;
use Guanguans\MonorepoBuilderWorker\PhpUpdateChangelogReleaseWorker;
use Guanguans\MonorepoBuilderWorker\Support\EnvironmentChecker;
use Symplify\MonorepoBuilder\Config\MBConfig;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\AddTagToChangelogReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\PushNextDevReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\PushTagReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\SetCurrentMutualDependenciesReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\SetNextMutualDependenciesReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\TagVersionReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateBranchAliasReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateReplaceReleaseWorker;

return static function (MBConfig $mbConfig): void {
require __DIR__.'/vendor/autoload.php';
$mbConfig->defaultBranch('main');

/**
* release workers - in order to execute
*
* @see https://github.com/symplify/monorepo-builder#6-release-flow
*/
$mbConfig->workers($workers = [
// UpdateReplaceReleaseWorker::class,
// SetCurrentMutualDependenciesReleaseWorker::class,
// AddTagToChangelogReleaseWorker::class,
// NodeUpdateChangelogReleaseWorker::class,
TagVersionReleaseWorker::class,
PushTagReleaseWorker::class,
GoUpdateChangelogReleaseWorker::class,
// PhpUpdateChangelogReleaseWorker::class,
CreateGithubReleaseWorker::class,
// SetNextMutualDependenciesReleaseWorker::class,
// UpdateBranchAliasReleaseWorker::class,
// PushNextDevReleaseWorker::class,
]);

EnvironmentChecker::checks($workers);
};
15 changes: 0 additions & 15 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector;
use Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector;
use Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector;
use Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
Expand All @@ -29,15 +28,12 @@
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector;
use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector;
use Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector;
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\PHPUnit\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\PHPUnit\Rector\MethodCall\RemoveExpectAnyFromMockRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
Expand Down Expand Up @@ -84,7 +80,6 @@
// rules
// AddArrayDefaultToArrayPropertyRector::class,
// AddDefaultValueForUndefinedVariableRector::class,
// AddSeeTestAnnotationRector::class,
// CallableThisArrayToAnonymousFunctionRector::class,
// ChangeAndIfToEarlyReturnRector::class,
// ExplicitBoolCompareRector::class,
Expand All @@ -98,9 +93,7 @@
EncapsedStringsToSprintfRector::class,
// InlineIfToExplicitIfRector::class,
LogicalToBooleanRector::class,
ReturnBinaryAndToEarlyReturnRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
VarConstantCommentRector::class,

DisallowedEmptyRuleFixerRector::class => [
// __DIR__.'/src/Support/QueryAnalyzer.php',
Expand All @@ -120,9 +113,6 @@
StaticClosureRector::class => [
__DIR__.'/tests',
],
// RemoveExpectAnyFromMockRector::class => [
// __DIR__.'/tests/Concerns/WithDumpableTest.php',
// ],
// ReturnEarlyIfVariableRector::class => [
// __DIR__.'/src/Support/EscapeArg.php',
// ],
Expand Down Expand Up @@ -150,7 +140,6 @@

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_74,
SetList::PHP_74,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
Expand All @@ -165,12 +154,8 @@

PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_91,
// PHPUnitSetList::PHPUNIT80_DMS,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_EXCEPTION,
PHPUnitSetList::REMOVE_MOCKS,
PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD,
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);

Expand Down

0 comments on commit 4198531

Please sign in to comment.