-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmonorepo-builder.php
120 lines (106 loc) · 3.61 KB
/
monorepo-builder.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
declare(strict_types=1);
use Symplify\MonorepoBuilder\Config\MBConfig;
use Symplify\MonorepoBuilder\ComposerJsonManipulator\ValueObject\ComposerJsonSection;
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;
/**
* Mono-repository configuration
*
* @see https://github.com/symplify/monorepo-builder
*/
return static function (MBConfig $config): void {
// Set the default branch name (used to be "master")...
$config->defaultBranch('main');
// Location of packages...etc
$config->packageDirectories([
// default value
__DIR__ . '/packages',
]);
// Remove from root composer.json
$config->dataToRemove([
ComposerJsonSection::REQUIRE => [
// the line is removed by key, so version is irrelevant, thus *
'codeception/codeception' => '*',
"codeception/module-asserts" => '*',
'orchestra/testbench' => '*',
'orchestra/testbench-dusk' => '*',
'illuminate/testing' => '*'
],
]);
// Append to root composer.json
$config->dataToAppend([
ComposerJsonSection::REQUIRE_DEV => [
'ext-sockets' => '*',
'ext-curl' => '*',
'bamarni/composer-bin-plugin' => '^1.8.2',
'roave/security-advisories' => 'dev-master',
'codeception/codeception' => '^5.1.2',
"codeception/module-asserts" => "^3.0.0",
'orchestra/testbench' => '^v9.9.0',
'orchestra/testbench-dusk' => '^v9.11.1',
'illuminate/testing' => '^v11.36.1'
],
ComposerJsonSection::AUTOLOAD => [
'psr-4' => [
'Aedart\\' => 'src',
],
],
ComposerJsonSection::AUTOLOAD_DEV => [
// 'psr-4' => [
// 'phpstan/phpstan\\' => '^0.12',
// ],
],
]);
// Packages
// $config->packageDirectories([
//
// ]);
// Package alias format
$config->packageAliasFormat('<major>.<minor>.x-dev');
// Section order in composer.json files
$config->composerSectionOrder([
'name',
'type',
'description',
'keywords',
'homepage',
'support',
'license',
'authors',
'repositories',
'require',
'require-dev',
'autoload',
'autoload-dev',
'replace',
'provide',
'bin',
'conflict',
'suggest',
'scripts',
'scripts-descriptions',
'config',
'minimum-stability',
'prefer-stable',
'extra',
]);
/*****************************************************************
* Release Workers
****************************************************************/
$config->workers([
UpdateReplaceReleaseWorker::class,
SetCurrentMutualDependenciesReleaseWorker::class,
// AddTagToChangelogReleaseWorker::class,
TagVersionReleaseWorker::class,
PushTagReleaseWorker::class,
SetNextMutualDependenciesReleaseWorker::class,
UpdateBranchAliasReleaseWorker::class,
PushNextDevReleaseWorker::class,
]);
};