-
Notifications
You must be signed in to change notification settings - Fork 28
/
monorepo-builder.php
65 lines (60 loc) · 2.11 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
<?php
declare(strict_types=1);
use Symplify\MonorepoBuilder\ComposerJsonManipulator\ValueObject\ComposerJsonSection;
use Symplify\MonorepoBuilder\Config\MBConfig;
return static function (MBConfig $config): void {
$config->defaultBranch('1.x');
$config->packageDirectories([
__DIR__ . '/src/core',
__DIR__ . '/src/cli',
__DIR__ . '/src/adapter',
__DIR__ . '/src/bridge',
__DIR__ . '/src/lib',
]);
$config->dataToAppend([
ComposerJsonSection::SCRIPTS => [
"build" => [
"@static:analyze",
"@test",
"@test:mutation"
],
"test" => [
"tools/phpunit/vendor/bin/phpunit"
],
"test:mutation" => [
"tools/infection/vendor/bin/infection -j2"
],
"static:analyze" => [
"tools/psalm/vendor/bin/psalm.phar --output-format=compact",
"tools/phpstan/vendor/bin/phpstan analyze -c phpstan.neon",
"tools/cs-fixer/vendor/bin/php-cs-fixer fix --dry-run"
],
"cs:php:fix" => [
"tools/cs-fixer/vendor/bin/php-cs-fixer fix"
],
"post-install-cmd" => [
"@tools:install"
],
"post-update-cmd" => [
"@tools:install"
],
"tools:install" => [
"composer install --working-dir=./tools/cs-fixer",
"composer install --working-dir=./tools/infection",
"composer install --working-dir=./tools/monorepo",
"composer install --working-dir=./tools/phpstan",
"composer install --working-dir=./tools/psalm",
"composer install --working-dir=./tools/phpunit"
]
]
]);
$config->dataToRemove([
ComposerJsonSection::REQUIRE_DEV => [
"phpunit/phpunit" => "*",
"infection/infection" => "*",
"friendsofphp/php-cs-fixer" => "*",
"phpstan/phpstan" => "*",
"vimeo/psalm" => "*",
]
]);
};