build: 更新构建配置

Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
This commit is contained in:
李东云
2023-09-27 14:51:20 +08:00
parent 63ac5a7845
commit 4006b90a2e
4 changed files with 137 additions and 125 deletions

View File

@@ -59,10 +59,6 @@
{
"filename": "VERSION_TRACKER.txt",
"type": "plain-text"
},
{
"filename": "composer.json",
"type": "json"
}
]
}

View File

@@ -1,113 +1,121 @@
{
"name": "singularity/hdk-skeleton",
"license": "MIT",
"type": "project",
"description": "HDK 骨架",
"authors": [
{
"name": "李东云",
"email": "dongyun.li@luxcreo.ai"
}
],
"extra": {
"hyperf": {
"config": "Singularity\\HDK\\Skeleton\\ConfigProvider"
},
"hooks": {
"config": {
"stop-on-failure": [
"pre-push"
]
},
"pre-push": [
"echo committing as $(git config user.name)",
"docker run --rm -t -v \"$(pwd)\":/srv/www harbor.luxcreo.cn/library/hyperf:8.1-swoole composer ci"
]
}
"name": "singularity/hdk-skeleton",
"license": "MIT",
"type": "project",
"description": "HDK 骨架",
"authors": [
{
"name": "李东云",
"email": "dongyun.li@luxcreo.ai"
}
],
"extra": {
"hyperf": {
"config": "Singularity\\HDK\\Skeleton\\ConfigProvider"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Installer\\": "installer/"
}
},
"autoload-dev": {
"psr-4": {
"Test\\": "test/"
}
},
"require": {
"php": "^8.1",
"composer/composer": ">=2.5.5",
"hyperf/constants": "^3.0.18",
"hyperf/database": "^3.0.18",
"hyperf/db-connection": "^3.0.18",
"hyperf/di": "^3.0.18",
"hyperf/paginator": "^3.0.18",
"hyperf/session": "^3.0.18",
"hyperf/translation": "^3.0.18",
"hyperf/validation": "^3.0.18",
"singularity/hdk-core": "^1.0",
"symfony/polyfill-php81": "^1.27.0"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.8.5",
"friendsofphp/php-cs-fixer": "^v3.16.0",
"hyperf/devtool": "^3.0.18",
"hyperf/testing": "^3.0.18",
"pestphp/pest": "^1.23",
"phpstan/phpstan": "^1.10.15",
"swoole/ide-helper": "^4.8.13"
},
"prefer-stable": true,
"minimum-stability": "dev",
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"secure-http": false,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"pre-install-cmd": "Installer\\Script::install",
"pre-update-cmd": "Installer\\Script::install",
"post-install-cmd": "cghooks add --ignore-lock",
"post-update-cmd": "cghooks update",
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-autoload-dump": [
"rm -rf runtime/container"
],
"test": [
"rm -rf runtime",
"Composer\\Config::disableProcessTimeout",
"co-phpunit --prepend test/bootstrap.php -c phpunit.xml --colors=always"
],
"cs-fix": "vendor/bin/php-cs-fixer fix $1 --rules=@PSR12 --allow-risky=yes",
"analyse": "vendor/bin/phpstan analyse $1",
"ci": [
"@analyse app/ test/",
"@cs-fix",
"@test",
"echo CI Success"
],
"start": [
"rm -rf runtime",
"Composer\\Config::disableProcessTimeout",
"php ./bin/hyperf.php start"
"hooks": {
"config": {
"stop-on-failure": [
"pre-push"
]
},
"pre-push": [
"echo committing as $(git config user.name)",
"docker run --rm -t -v \"$(pwd)\":/srv/www harbor.luxcreo.cn/library/hyperf:8.1-swoole composer ci"
]
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Installer\\": "installer/"
}
},
"autoload-dev": {
"psr-4": {
"Test\\": "test/"
}
},
"require": {
"php": "^8.1",
"composer/composer": ">=2.5.5",
"hyperf/constants": "^3.0.18",
"hyperf/database": "^3.0.18",
"hyperf/db-connection": "^3.0.18",
"hyperf/di": "^3.0.18",
"hyperf/paginator": "^3.0.18",
"hyperf/session": "^3.0.18",
"hyperf/translation": "^3.0.18",
"hyperf/validation": "^3.0.18",
"singularity/hdk-core": "^1.0",
"symfony/polyfill-php81": "^1.27.0"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.8.5",
"cooper/hyperf-pest": "^1.1",
"daodao97/hyperf-watch": "dev-master",
"friendsofphp/php-cs-fixer": "^3.0",
"hyperf/devtool": "3.0.*",
"hyperf/testing": "3.0.*",
"mockery/mockery": "^1.0",
"phpstan/phpstan": "^1.8",
"roave/security-advisories": "dev-latest",
"swoole/ide-helper": "^5.0"
},
"prefer-stable": true,
"minimum-stability": "dev",
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"secure-http": false,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"pre-install-cmd": "Installer\\Script::install",
"pre-update-cmd": "Installer\\Script::install",
"post-install-cmd": "cghooks add --ignore-lock",
"post-update-cmd": "cghooks update",
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-autoload-dump": [
"rm -rf runtime/container"
],
"test": [
"rm -rf runtime",
"Composer\\Config::disableProcessTimeout",
"APP_STATUS=false co-pest --prepend test/bootstrap.php -c phpunit.xml --colors=always $1"
],
"cs-fix": "php-cs-fixer fix $1 --rules=@PSR12 --allow-risky=yes",
"analyse": "phpstan analyse $1",
"ci": [
"@analyse app/ config/ test/",
"@cs-fix",
"@test",
"echo CI Success"
],
"start": [
"rm -rf runtime",
"Composer\\Config::disableProcessTimeout",
"php ./bin/hyperf.php start"
],
"watch": [
"rm -fr runtime/*",
"Composer\\Config::disableProcessTimeout",
"./vendor/bin/watch"
]
},
"repositories": {
"lux-map": {
"type": "composer",
"url": "https://satis.luxcreo.cn/"
},
"repositories": {
"lux-map": {
"type": "composer",
"url": "https://satis.luxcreo.cn/"
},
"packagist": {
"type": "composer",
"url": "https://mirrors.cloud.tencent.com/composer/"
}
},
"version": "1.0.0-alpha.0"
"packagist": {
"type": "composer",
"url": "https://mirrors.cloud.tencent.com/composer/"
}
},
"version": "1.0.0-alpha.0"
}

View File

@@ -1,13 +0,0 @@
parameters:
level: 6
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
paths:
- publish
- src
- testsi
ignoreErrors:
- '#Constant BASE_PATH not found#'
- '#Property [a-zA-Z0-9\\_]+::\$[a-zA-Z0-9]+ is never written, only read\.#'
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) is unused\.#'
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) has parameter \$response with no value type specified in iterable type array\.#'

21
phpstan.neon Normal file
View File

@@ -0,0 +1,21 @@
# Magic behaviour with __get, __set, __call and __callStatic is not exactly static analyser-friendly :)
# Fortunately, You can ignore it by the following config.
#
# vendor/bin/phpstan analyse app --memory-limit 200M -l 0
#
parameters:
level: 0
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- '#Static call to instance method Hyperf\\HttpServer\\Router\\Router::[a-zA-Z0-9\\_]+\(\)#'
- '#Static call to instance method Hyperf\\DbConnection\\Db::[a-zA-Z0-9\\_]+\(\)#'
- '#Constant BASE_PATH not found#'
- '#Property [a-zA-Z0-9\\_]+::\$[a-zA-Z0-9]+ is never written, only read.#'
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9_]+\(\) has parameter \$[a-zA-Z0-9_]+ with no value type specified in iterable type array.#'
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9_]+\(\) has parameter \$[a-zA-Z0-9_]+ with no type specified.#'
- '#Static call to instance method App\\Constants\\ErrorCode::getMessage\(\).#'
- '#Template type [a-zA-Z0-9]+ of method [a-zA-Z0-9\\_]+::[a-zA-Z0-9_]+\(\) is not referenced in a parameter.#'
- '#Call to an undefined method Hyperf\\Database\\Query\\Builder::firstOrFail\(\).#'
- '#Method App\\Service\\Auth\\TokenServiceInterface::generate\(\) invoked with 1 parameter, 2 required.#'
- '#Call to an undefined method Hyperf\\Contract\\SessionInterface::isValidId\(\).#'
- '#Call to an undefined method LightSaml\\Model\\Protocol\\SamlMessage::setInResponseTo\(\).#'