Fixed composer.json

This commit is contained in:
李铭昕 2021-06-29 13:41:42 +08:00
parent 64bda4be71
commit 5e515f5452
5 changed files with 115 additions and 93 deletions

View File

@ -62,6 +62,7 @@
- [#3728](https://github.com/hyperf/hyperf/pull/3728) Added support for `secret` of Apollo.
- [#3743](https://github.com/hyperf/hyperf/pull/3743) Support custom register for service governance.
- [#3753](https://github.com/hyperf/hyperf/pull/3753) Support long pulling mode for Apollo Client.
- [#3759](https://github.com/hyperf/hyperf/pull/3759) Added `rpc-multiplex` component.
## Optimized

View File

@ -20,9 +20,13 @@ $autoload = [];
$autoloadFiles = [];
$autoloadDev = [];
$configProviders = [];
$replaces = [];
foreach ($files as $file) {
$component = basename(dirname($file));
$composerJson = json_decode(file_get_contents($file), true);
if(isset($composerJson['name']) && str_starts_with($composerJson['name'], 'hyperf')){
$replaces[$composerJson['name']] = '*';
}
foreach ($composerJson['autoload']['files'] ?? [] as $file) {
$autoloadFiles[] = "src/{$component}/" . preg_replace('#^./#', '', $file);
@ -42,12 +46,14 @@ ksort($autoload);
sort($autoloadFiles);
ksort($autoloadDev);
sort($configProviders);
ksort($replaces);
$json = json_decode(file_get_contents(__DIR__ . '/../composer.json'));
$json->autoload->files = $autoloadFiles;
$json->autoload->{'psr-4'} = $autoload;
$json->{'autoload-dev'}->{'psr-4'} = $autoloadDev;
$json->extra->hyperf->config = $configProviders;
$json->replace = $replaces;
file_put_contents(
__DIR__ . '/../composer.json',

View File

@ -56,6 +56,7 @@
"mix/redis-subscribe": "^2.1",
"mockery/mockery": "^1.0",
"monolog/monolog": "^2.0",
"multiplex/socket": "^0.4.0",
"nesbot/carbon": "^2.0",
"nikic/fast-route": "^1.3",
"nikic/php-parser": "^4.1",
@ -86,66 +87,93 @@
"xxtime/flysystem-aliyun-oss": "^1.5"
},
"replace": {
"hyperf/amqp": "self.version",
"hyperf/async-queue": "self.version",
"hyperf/circuit-breaker": "self.version",
"hyperf/cache": "self.version",
"hyperf/command": "self.version",
"hyperf/config": "self.version",
"hyperf/config-aliyun-acm": "self.version",
"hyperf/config-apollo": "self.version",
"hyperf/config-center": "self.version",
"hyperf/config-etcd": "self.version",
"hyperf/config-nacos": "self.version",
"hyperf/config-zookeeper": "self.version",
"hyperf/constants": "self.version",
"hyperf/consul": "self.version",
"hyperf/contract": "self.version",
"hyperf/database": "self.version",
"hyperf/db-connection": "self.version",
"hyperf/devtool": "self.version",
"hyperf/di": "self.version",
"hyperf/dispatcher": "self.version",
"hyperf/elasticsearch": "self.version",
"hyperf/etcd": "self.version",
"hyperf/event": "self.version",
"hyperf/exception-handler": "self.version",
"hyperf/filesystem": "self.version",
"hyperf/framework": "self.version",
"hyperf/graphql": "self.version",
"hyperf/grpc": "self.version",
"hyperf/grpc-client": "self.version",
"hyperf/grpc-server": "self.version",
"hyperf/guzzle": "self.version",
"hyperf/http-message": "self.version",
"hyperf/http-server": "self.version",
"hyperf/logger": "self.version",
"hyperf/memory": "self.version",
"hyperf/metric": "self.version",
"hyperf/model-cache": "self.version",
"hyperf/paginator": "self.version",
"hyperf/pool": "self.version",
"hyperf/process": "self.version",
"hyperf/rate-limit": "self.version",
"hyperf/reactive-x": "self.version",
"hyperf/redis": "self.version",
"hyperf/retry": "self.version",
"hyperf/resource": "self.version",
"hyperf/resource-grpc": "self.version",
"hyperf/server": "self.version",
"hyperf/service-governance": "self.version",
"hyperf/session": "self.version",
"hyperf/socketio-server": "self.version",
"hyperf/swagger": "self.version",
"hyperf/task": "self.version",
"hyperf/tracer": "self.version",
"hyperf/translation": "self.version",
"hyperf/utils": "self.version",
"hyperf/validation": "self.version",
"hyperf/view": "self.version",
"hyperf/view-engine": "self.version",
"hyperf/websocket-client": "self.version",
"hyperf/websocket-server": "self.version"
"hyperf/amqp": "*",
"hyperf/async-queue": "*",
"hyperf/cache": "*",
"hyperf/circuit-breaker": "*",
"hyperf/command": "*",
"hyperf/config": "*",
"hyperf/config-aliyun-acm": "*",
"hyperf/config-apollo": "*",
"hyperf/config-center": "*",
"hyperf/config-etcd": "*",
"hyperf/config-nacos": "*",
"hyperf/config-zookeeper": "*",
"hyperf/constants": "*",
"hyperf/consul": "*",
"hyperf/contract": "*",
"hyperf/crontab": "*",
"hyperf/dag": "*",
"hyperf/database": "*",
"hyperf/db": "*",
"hyperf/db-connection": "*",
"hyperf/devtool": "*",
"hyperf/di": "*",
"hyperf/dispatcher": "*",
"hyperf/elasticsearch": "*",
"hyperf/etcd": "*",
"hyperf/event": "*",
"hyperf/exception-handler": "*",
"hyperf/filesystem": "*",
"hyperf/framework": "*",
"hyperf/graphql": "*",
"hyperf/grpc": "*",
"hyperf/grpc-client": "*",
"hyperf/grpc-server": "*",
"hyperf/guzzle": "*",
"hyperf/http-message": "*",
"hyperf/http-server": "*",
"hyperf/ide-helper": "*",
"hyperf/json-rpc": "*",
"hyperf/kafka": "*",
"hyperf/load-balancer": "*",
"hyperf/logger": "*",
"hyperf/memory": "*",
"hyperf/metric": "*",
"hyperf/model-cache": "*",
"hyperf/model-listener": "*",
"hyperf/nacos": "*",
"hyperf/nats": "*",
"hyperf/nsq": "*",
"hyperf/paginator": "*",
"hyperf/phar": "*",
"hyperf/pool": "*",
"hyperf/process": "*",
"hyperf/protocol": "*",
"hyperf/rate-limit": "*",
"hyperf/reactive-x": "*",
"hyperf/redis": "*",
"hyperf/resource": "*",
"hyperf/resource-grpc": "*",
"hyperf/retry": "*",
"hyperf/rpc": "*",
"hyperf/rpc-client": "*",
"hyperf/rpc-multiplex": "*",
"hyperf/rpc-server": "*",
"hyperf/rpn": "*",
"hyperf/scout": "*",
"hyperf/server": "*",
"hyperf/service-governance": "*",
"hyperf/service-governance-nacos": "*",
"hyperf/session": "*",
"hyperf/signal": "*",
"hyperf/snowflake": "*",
"hyperf/socket": "*",
"hyperf/socketio-server": "*",
"hyperf/super-globals": "*",
"hyperf/swagger": "*",
"hyperf/swoole-tracker": "*",
"hyperf/task": "*",
"hyperf/testing": "*",
"hyperf/tracer": "*",
"hyperf/translation": "*",
"hyperf/utils": "*",
"hyperf/validation": "*",
"hyperf/view": "*",
"hyperf/view-engine": "*",
"hyperf/watcher": "*",
"hyperf/websocket-client": "*",
"hyperf/websocket-server": "*"
},
"suggest": {},
"autoload": {
@ -217,6 +245,7 @@
"Hyperf\\Resource\\": "src/resource/src/",
"Hyperf\\Retry\\": "src/retry/src/",
"Hyperf\\RpcClient\\": "src/rpc-client/src/",
"Hyperf\\RpcMultiplex\\": "src/rpc-multiplex/src/",
"Hyperf\\RpcServer\\": "src/rpc-server/src/",
"Hyperf\\Rpc\\": "src/rpc/src/",
"Hyperf\\Rpn\\": "src/rpn/src/",
@ -301,6 +330,7 @@
"HyperfTest\\Resource\\": "src/resource/tests/",
"HyperfTest\\Retry\\": "src/retry/tests/",
"HyperfTest\\RpcClient\\": "src/rpc-client/tests/",
"HyperfTest\\RpcMultiplex\\": "src/rpc-multiplex/tests/",
"HyperfTest\\RpcServer\\": "src/rpc-server/tests/",
"HyperfTest\\Rpc\\": "src/rpc/tests/",
"HyperfTest\\Rpn\\": "src/rpn/tests/",
@ -392,6 +422,7 @@
"Hyperf\\Resource\\ConfigProvider",
"Hyperf\\Retry\\ConfigProvider",
"Hyperf\\RpcClient\\ConfigProvider",
"Hyperf\\RpcMultiplex\\ConfigProvider",
"Hyperf\\RpcServer\\ConfigProvider",
"Hyperf\\Rpn\\ConfigProvider",
"Hyperf\\Scout\\ConfigProvider",

View File

@ -56,6 +56,7 @@
<directory suffix="Test.php">./src/retry/tests</directory>
<directory suffix="Test.php">./src/rpc/tests</directory>
<directory suffix="Test.php">./src/rpc-client/tests</directory>
<directory suffix="Test.php">./src/rpc-multiplex/tests</directory>
<directory suffix="Test.php">./src/rpc-server/tests</directory>
<directory suffix="Test.php">./src/rpn/tests</directory>
<directory suffix="Test.php">./src/scout/tests</directory>
@ -112,6 +113,8 @@
<directory suffix=".php">./src/phar/src</directory>
<directory suffix=".php">./src/redis/src</directory>
<directory suffix=".php">./src/rpc/src</directory>
<directory suffix=".php">./src/rpc-client/src</directory>
<directory suffix=".php">./src/rpc-multiplex/src</directory>
<directory suffix=".php">./src/rpn/src</directory>
<directory suffix=".php">./src/scout/src</directory>
<directory suffix=".php">./src/server/src</directory>

View File

@ -1,5 +1,5 @@
{
"name": "hyperf/rpc-multiplex-incubator",
"name": "hyperf/rpc-multiplex",
"type": "library",
"license": "MIT",
"keywords": [
@ -7,6 +7,18 @@
"hyperf"
],
"description": "Rpc for multiplexing connection",
"require": {
"php": ">=7.3",
"hyperf/framework": "~2.2.0",
"hyperf/http-message": "~2.2.0",
"hyperf/load-balancer": "~2.2.0",
"hyperf/rpc": "~2.2.0",
"hyperf/rpc-client": "~2.2.0",
"hyperf/rpc-server": "~2.2.0",
"hyperf/server": "~2.2.0",
"hyperf/utils": "~2.2.0",
"multiplex/socket": "^0.4"
},
"autoload": {
"psr-4": {
"Hyperf\\RpcMultiplex\\": "src/"
@ -17,46 +29,15 @@
"HyperfTest\\RpcMultiplex\\": "tests/"
}
},
"require": {
"php": ">=7.3",
"hyperf/framework": "^2.1",
"hyperf/http-message": "^2.1",
"hyperf/load-balancer": "^2.1",
"hyperf/rpc": "^2.1",
"hyperf/rpc-client": "^2.1",
"hyperf/rpc-server": "^2.1",
"hyperf/server": "^2.1",
"hyperf/utils": "^2.1",
"multiplex/socket": "^0.4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"hyperf/config": "^2.1",
"hyperf/di": "^2.1",
"mockery/mockery": "^1.0",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": ">=7.0",
"swoole/ide-helper": "dev-master",
"swow/swow": "dev-develop",
"symfony/var-dumper": "^5.1"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"optimize-autoloader": true,
"sort-packages": true
},
"scripts": {
"test": "phpunit -c phpunit.xml --colors=always",
"analyse": "phpstan analyse --memory-limit 1024M -l 5 -c phpstan.neon ./src",
"cs-fix": "php-cs-fixer fix $1"
},
"extra": {
"hyperf": {
"config": "Hyperf\\RpcMultiplex\\ConfigProvider"
},
"branch-alias": {
"dev-main": "0.4-dev"
"dev-master": "2.1-dev"
}
}
}