feat(bin): 增加了迁移到最新版本的脚本

Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
This commit is contained in:
李东云
2023-12-14 16:28:59 +08:00
parent 97131d224c
commit 7d6dc7fe9f
4 changed files with 211 additions and 193 deletions

19
bin/hdk-migrate-core.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
# shellcheck disable=SC2039
LIB_HOME_DIR="$(pwd)/vendor/singularity/hdk-core"
LATEST_VERSION=$(cat "${LIB_HOME_DIR}/VERSION_TRACKER.txt")
echo -e '\033[44;34;5m=============================\033[0m'
echo ''
$(pwd)/vendor/bin/rector \
process \
--autoload-file=vendor/autoload.php \
--config="${LIB_HOME_DIR}/hyperf31_rector.php"
echo ''
echo -e '\033[44;34;5m=============================\033[0m'
echo -e '\033[;31;1m🎉Congratulations!\033[0m'
echo "Now you have been migrated to HDK-Core v${LATEST_VERSION}!"
echo ''

View File

@@ -22,6 +22,7 @@
"ext-swoole": "*", "ext-swoole": "*",
"composer/composer": ">=2.0", "composer/composer": ">=2.0",
"ergebnis/http-method": "^2.5", "ergebnis/http-method": "^2.5",
"friendsofhyperf/rector": "^0.1.5",
"hyperf/config": "3.1.*", "hyperf/config": "3.1.*",
"hyperf/constants": "3.1.*", "hyperf/constants": "3.1.*",
"hyperf/context": "3.1.*", "hyperf/context": "3.1.*",
@@ -45,7 +46,6 @@
"alibabacloud/dysmsapi-20170525": "^2.0", "alibabacloud/dysmsapi-20170525": "^2.0",
"firebase/php-jwt": "^6.9", "firebase/php-jwt": "^6.9",
"friendsofhyperf/pest-plugin-hyperf": "3.1.*", "friendsofhyperf/pest-plugin-hyperf": "3.1.*",
"friendsofhyperf/rector": "^0.1.5",
"friendsofphp/php-cs-fixer": "^3.41.1", "friendsofphp/php-cs-fixer": "^3.41.1",
"guzzlehttp/guzzle": "^7.8", "guzzlehttp/guzzle": "^7.8",
"hyperf/crontab": "3.1.*", "hyperf/crontab": "3.1.*",

382
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "917798670c1e06a83de5fc813e78b389", "content-hash": "4e2d967f4160b73e3532ed218e4107e7",
"packages": [ "packages": [
{ {
"name": "composer/ca-bundle", "name": "composer/ca-bundle",
@@ -989,6 +989,61 @@
}, },
"time": "2020-11-24T22:02:12+00:00" "time": "2020-11-24T22:02:12+00:00"
}, },
{
"name": "friendsofhyperf/rector",
"version": "v0.1.5",
"source": {
"type": "git",
"url": "https://github.com/friendsofhyperf/rector.git",
"reference": "896ec187d0b85ac2b2db5e7201a21fbfdf4f3e54"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/friendsofhyperf/rector/zipball/896ec187d0b85ac2b2db5e7201a21fbfdf4f3e54",
"reference": "896ec187d0b85ac2b2db5e7201a21fbfdf4f3e54",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=8.0",
"rector/rector": "^0.15.12"
},
"require-dev": {
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8.2",
"phpstan/phpstan-strict-rules": "^1.2",
"phpstan/phpstan-webmozart-assert": "^1.1",
"phpunit/phpunit": "^10.0",
"rector/phpstan-rules": "^0.6",
"rector/rector-debugging": "dev-main",
"symplify/easy-coding-standard": "^11.0",
"symplify/phpstan-extensions": "^11.0",
"symplify/phpstan-rules": "^11.0",
"symplify/rule-doc-generator": "^11.0",
"symplify/vendor-patches": "^11.0"
},
"type": "rector-extension",
"autoload": {
"psr-4": {
"Rector\\Hyperf\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Rector upgrades rules for Hyperf.",
"support": {
"issues": "https://github.com/friendsofhyperf/rector/issues",
"source": "https://github.com/friendsofhyperf/rector/tree/v0.1.5"
},
"time": "2023-06-26T23:32:12+00:00"
},
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
"version": "v1.1.2", "version": "v1.1.2",
@@ -3763,6 +3818,74 @@
], ],
"time": "2023-11-12T21:59:55+00:00" "time": "2023-11-12T21:59:55+00:00"
}, },
{
"name": "phpstan/phpstan",
"version": "1.10.49",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "9367ba4c4f6ad53e9efb594d74a8941563caccf6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/9367ba4c4f6ad53e9efb594d74a8941563caccf6",
"reference": "9367ba4c4f6ad53e9efb594d74a8941563caccf6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.2|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2023-12-12T10:05:12+00:00"
},
{ {
"name": "psr/container", "name": "psr/container",
"version": "2.0.2", "version": "2.0.2",
@@ -4191,6 +4314,73 @@
], ],
"time": "2023-07-11T16:12:49+00:00" "time": "2023-07-11T16:12:49+00:00"
}, },
{
"name": "rector/rector",
"version": "0.15.25",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "015935c7ed9e48a4f5895ba974f337e20a263841"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/015935c7ed9e48a4f5895ba974f337e20a263841",
"reference": "015935c7ed9e48a4f5895ba974f337e20a263841",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.2|^8.0",
"phpstan/phpstan": "^1.10.14"
},
"conflict": {
"rector/rector-doctrine": "*",
"rector/rector-downgrade-php": "*",
"rector/rector-phpunit": "*",
"rector/rector-symfony": "*"
},
"bin": [
"bin/rector"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "0.15-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Instant Upgrade and Automated Refactoring of any PHP code",
"keywords": [
"automation",
"dev",
"migration",
"refactoring"
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/0.15.25"
},
"funding": [
{
"url": "https://github.com/tomasvotruba",
"type": "github"
}
],
"time": "2023-04-20T16:07:39+00:00"
},
{ {
"name": "roave/dont", "name": "roave/dont",
"version": "1.6.0", "version": "1.6.0",
@@ -7290,61 +7480,6 @@
}, },
"time": "2023-12-02T16:49:21+00:00" "time": "2023-12-02T16:49:21+00:00"
}, },
{
"name": "friendsofhyperf/rector",
"version": "v0.1.5",
"source": {
"type": "git",
"url": "https://github.com/friendsofhyperf/rector.git",
"reference": "896ec187d0b85ac2b2db5e7201a21fbfdf4f3e54"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/friendsofhyperf/rector/zipball/896ec187d0b85ac2b2db5e7201a21fbfdf4f3e54",
"reference": "896ec187d0b85ac2b2db5e7201a21fbfdf4f3e54",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=8.0",
"rector/rector": "^0.15.12"
},
"require-dev": {
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8.2",
"phpstan/phpstan-strict-rules": "^1.2",
"phpstan/phpstan-webmozart-assert": "^1.1",
"phpunit/phpunit": "^10.0",
"rector/phpstan-rules": "^0.6",
"rector/rector-debugging": "dev-main",
"symplify/easy-coding-standard": "^11.0",
"symplify/phpstan-extensions": "^11.0",
"symplify/phpstan-rules": "^11.0",
"symplify/rule-doc-generator": "^11.0",
"symplify/vendor-patches": "^11.0"
},
"type": "rector-extension",
"autoload": {
"psr-4": {
"Rector\\Hyperf\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Rector upgrades rules for Hyperf.",
"support": {
"issues": "https://github.com/friendsofhyperf/rector/issues",
"source": "https://github.com/friendsofhyperf/rector/tree/v0.1.5"
},
"time": "2023-06-26T23:32:12+00:00"
},
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.41.1", "version": "v3.41.1",
@@ -9873,74 +10008,6 @@
}, },
"time": "2023-11-26T18:29:22+00:00" "time": "2023-11-26T18:29:22+00:00"
}, },
{
"name": "phpstan/phpstan",
"version": "1.10.49",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "9367ba4c4f6ad53e9efb594d74a8941563caccf6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/9367ba4c4f6ad53e9efb594d74a8941563caccf6",
"reference": "9367ba4c4f6ad53e9efb594d74a8941563caccf6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.2|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2023-12-12T10:05:12+00:00"
},
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "10.1.10", "version": "10.1.10",
@@ -10628,73 +10695,6 @@
}, },
"time": "2019-03-08T08:55:37+00:00" "time": "2019-03-08T08:55:37+00:00"
}, },
{
"name": "rector/rector",
"version": "0.15.25",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "015935c7ed9e48a4f5895ba974f337e20a263841"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/015935c7ed9e48a4f5895ba974f337e20a263841",
"reference": "015935c7ed9e48a4f5895ba974f337e20a263841",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.2|^8.0",
"phpstan/phpstan": "^1.10.14"
},
"conflict": {
"rector/rector-doctrine": "*",
"rector/rector-downgrade-php": "*",
"rector/rector-phpunit": "*",
"rector/rector-symfony": "*"
},
"bin": [
"bin/rector"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "0.15-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Instant Upgrade and Automated Refactoring of any PHP code",
"keywords": [
"automation",
"dev",
"migration",
"refactoring"
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/0.15.25"
},
"funding": [
{
"url": "https://github.com/tomasvotruba",
"type": "github"
}
],
"time": "2023-04-20T16:07:39+00:00"
},
{ {
"name": "roave/security-advisories", "name": "roave/security-advisories",
"version": "dev-latest", "version": "dev-latest",

View File

@@ -24,7 +24,6 @@ class ConfigProvider
/** @phpstan-ignore-next-line */ /** @phpstan-ignore-next-line */
public function __invoke(): array public function __invoke(): array
{ {
/** @noinspection PhpUndefinedConstantInspection */
return [ return [
// 合并到 config/autoload/dependencies.php 文件 // 合并到 config/autoload/dependencies.php 文件
'dependencies' => [ 'dependencies' => [