Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Split repo to small package (composer and repository for read-only) #238

Merged
merged 17 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/split.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Split Test

on:
push:
branches:
- master
tags:
- '*'

env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

jobs:
packages_split:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
package:
-
local_path: 'Collection'
split_repository: 'collection'
-
local_path: 'Console'
split_repository: 'console'
-
local_path: 'Container'
split_repository: 'container'
-
local_path: 'Cron'
split_repository: 'cron'
-
local_path: 'Database'
split_repository: 'database'
-
local_path: 'File'
split_repository: 'file'
-
local_path: 'Http'
split_repository: 'http'
-
local_path: 'Macroable'
split_repository: 'macroable'
-
local_path: 'Router'
split_repository: 'router'
-
local_path: 'Security'
split_repository: 'security'
-
local_path: 'Support'
split_repository: 'support'
-
local_path: 'Template'
split_repository: 'template'
-
local_path: 'Text'
split_repository: 'text'
-
local_path: 'Time'
split_repository: 'time'
-
local_path: 'View'
split_repository: 'view'

steps:
- uses: actions/checkout@v3

-
if: startsWith(github.ref, 'refs/tags/')
uses: "symplify/monorepo-split-github-action@v2.3.0"
with:
tag: ${GITHUB_REF#refs/tags/}

package_directory: 'src/System/${{ matrix.package.local_path }}'

repository_organization: 'SonyPradana'
repository_name: '${{ matrix.package.split_repository }}'

user_name: "SonyPradana"
user_email: "sonypradana@gmail.com"
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
->in(__DIR__ . DIRECTORY_SEPARATOR . 'tests')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'src')
->exclude(__DIR__ . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'Template')
->append(['.php-cs-fixer.php', 'rector.php']);
->append(['.php-cs-fixer.php', 'monorepo-builder.php', 'rector.php']);

$rules = [
'@Symfony' => true,
Expand Down
45 changes: 31 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "sonypradana/php-library",
"description": "library to build php mvc",
"keywords": ["framework", "php-mvc", "php-library"],
"keywords": [
"framework",
"php-mvc",
"php-library"
],
"license": "MIT",
"authors": [
{
Expand All @@ -20,6 +24,7 @@
"mockery/mockery": "^1.6",
"friendsofphp/php-cs-fixer": "^3.52",
"phpstan/phpstan": "^1.10",
"symplify/monorepo-builder": "^11.2",
"rector/rector": "^1.0"
},
"autoload": {
Expand All @@ -28,11 +33,11 @@
"System\\Support\\": "src/System/Macroable"
},
"files": [
"src/System/Collection/helper.php",
"src/System/Integrate/helper.php",
"src/System/Console/helper.php",
"src/System/Text/helper.php",
"src/System/Time/helper.php"
"src/System/Collection/helper.php",
"src/System/Integrate/helper.php",
"src/System/Console/helper.php",
"src/System/Text/helper.php",
"src/System/Time/helper.php"
]
},
"autoload-dev": {
Expand All @@ -43,18 +48,28 @@
"tests/Integrate/Commands/CommandTest.php"
]
},
"replace": {
"sonypradana/collection": "0.35.0",
"sonypradana/console": "0.35.0",
"sonypradana/container": "0.35.0",
"sonypradana/cron": "0.35.0",
"sonypradana/database": "0.35.0",
"sonypradana/file": "0.35.0",
"sonypradana/http": "0.35.0",
"sonypradana/integrate": "0.35.0",
"sonypradana/router": "0.35.0",
"sonypradana/security": "0.35.0",
"sonypradana/support": "0.35.0",
"sonypradana/template": "0.35.0",
"sonypradana/text": "0.35.0",
"sonypradana/time": "0.35.0",
"sonypradana/view": "0.35.0"
},
"extra": {
"laravel": {
"dont-discover": [
"*"
]
},
"branch-alias": {
"dev-master": "0.x-dev"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"refacto": "rector",
"lint": "php-cs-fixer fix -v",
Expand All @@ -74,5 +89,7 @@
"phpstan analyse --ansi --memory-limit=-1",
"phpunit --exclude-group database"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
25 changes: 25 additions & 0 deletions monorepo-builder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

use Symplify\MonorepoBuilder\Config\MBConfig;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\PushTagReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\SetCurrentMutualDependenciesReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\TagVersionReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateReplaceReleaseWorker;

return static function (MBConfig $config): void {
$config->packageDirectories([__DIR__ . '/src/System']);
$config->disableDefaultWorkers();

$config->workers([
// update root composer json
UpdateReplaceReleaseWorker::class,
// update child composer json
SetCurrentMutualDependenciesReleaseWorker::class,
// local tag
TagVersionReleaseWorker::class,
// push tag
PushTagReleaseWorker::class,
]);
};
13 changes: 13 additions & 0 deletions src/System/Collection/.github/workflows/close-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Close Pull Request

on:
pull_request_target:
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Thank you for your pull request. However, this repository is a read-only sub-split. Please submit your PR to https://github.com/sonypradana/php-library instead. Thanks!"
21 changes: 21 additions & 0 deletions src/System/Collection/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2024 Angger Pradana

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions src/System/Collection/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "sonypradana/collection",
"description": "part of php-library, manage array using collection",
"authors": [
{
"name": "Angger Pradana",
"email": "sonypradana@gmail.com"
}
],
"require": {
"php": "^8.0"
},
"autoload": {
"psr-4": {
"System\\Collection\\": ""
},
"files": [
"helper.php"
]
}
}
13 changes: 13 additions & 0 deletions src/System/Console/.github/workflows/close-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Close Pull Request

on:
pull_request_target:
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Thank you for your pull request. However, this repository is a read-only sub-split. Please submit your PR to https://github.com/sonypradana/php-library instead. Thanks!"
21 changes: 21 additions & 0 deletions src/System/Console/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2024 Angger Pradana

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 23 additions & 0 deletions src/System/Console/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "sonypradana/console",
"description": "part of php-library, console",
"authors": [
{
"name": "Angger Pradana",
"email": "sonypradana@gmail.com"
}
],
"require": {
"php": "^8.0",
"sonypradana/validator": "^0.8",
"sonypradana/text": "^0.35"
},
"autoload": {
"psr-4": {
"System\\Console\\": ""
},
"files": [
"helper.php"
]
}
}
13 changes: 13 additions & 0 deletions src/System/Container/.github/workflows/close-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Close Pull Request

on:
pull_request_target:
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Thank you for your pull request. However, this repository is a read-only sub-split. Please submit your PR to https://github.com/sonypradana/php-library instead. Thanks!"
21 changes: 21 additions & 0 deletions src/System/Container/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2024 Angger Pradana

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions src/System/Container/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "sonypradana/container",
"description": "part of php-library, dependency injection container",
"authors": [
{
"name": "Angger Pradana",
"email": "sonypradana@gmail.com"
}
],
"require": {
"php": "^8.0",
"php-di/php-di": "^7.0"
},
"autoload": {
"psr-4": {
"System\\Container\\": ""
}
}
}
13 changes: 13 additions & 0 deletions src/System/Cron/.github/workflows/close-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Close Pull Request

on:
pull_request_target:
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Thank you for your pull request. However, this repository is a read-only sub-split. Please submit your PR to https://github.com/sonypradana/php-library instead. Thanks!"
Loading
Loading