api-clients / installer
基于 YAML 的项目安装器
Requires
- php: ^7.0
- api-clients/branding: ^1.0
- beberlei/assert: ^2.7
- composer/composer: ^1.3
- igorw/get-in: ^1.0
- joshdifabio/composed: ^1.0
- nikic/php-parser: ^3.0 || ^2.0
- ocramius/package-versions: ^1.1
- roave/better-reflection: ^1.2
- symfony/console: 3.2.1
- symfony/yaml: ^3.2
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-15 07:20:44 UTC
README
基于 YAML 的项目安装器,灵感来源于 IceHawk installer
和 Koriym.PhpSkeleton
使用方法
require api-clients/installer
将 api-clients/installer
添加到 composer.json
的 require
部分。
post-create-project-cmd
建议使用以下 post-create-project-cmd
脚本。这是安装器运行所需的最小要求。例如,api-clients/skeleton
还在安装后运行资源生成、代码风格修复和 QA 检查。
{ "scripts": { "post-create-project-cmd": [ "ApiClients\\Tools\\Installer\\Installer::postCreateProject", "composer update --no-autoloader --ansi", "composer update --ansi" ] } }
installer.yml
在您想要使用安装器创建的包的根目录中创建一个 installer.yml
。以下配置来自 api-clients/skeleton
package: api-clients/skeleton text: welcome: "Welcome to the API Clients new client installer." ascii_art_file: - ascii.small.art - ascii.medium.art - ascii.large.art ascii_art_package: api-clients/branding config: current_ns: "ApiClients\\Skeleton" current_ns_tests: "ApiClients\\Tests\\Skeleton" require: - installer - installer-client-operations scripts: - post-create-project-cmd questions: author_name: description: "Author name" question: "What is your name?" author_email: description: "Author email" question: "What is your email address?" validate: "Assert\\Assertion::email" package_name: description: "Your package" question: "What is your package name?" default: "vendor-name/package-name" path_src: description: "Your project sources location" question: "What is your project sources location?" default: "src/" path_tests: description: "Your project tests location" question: "What is your project tests location?" default: "tests/" ns_vendor: description: "Your namespace" question: "What is your vendor namespace?" default: "MyVendor" ns_tests_vendor: description: "Your test namespace" question: "What is your vendor test namespace?" default: "MyVendor\\Tests" ns_project: description: "Your project namespace" question: "What is your project namespace?" default: "MyProject" operations: - "ApiClients\\Tools\\Installer\\Operation\\ComposerJson::create" - "ApiClients\\Tools\\Installer\\Operation\\UpdateNamespaces::create"
让我们分解一下并描述每个部分的作用
package
骨架包的名称。
text
用于在安装器开始时创建欢迎信息的文本选项。
text.welcome
欢迎信息。
text.ascii_art_file
ASCII 文件数组。
text.ascii_art_package
ASCII 艺术包,如果没有提供,则骨架将搜索 ASCII 艺术文件。
config
包含附加配置选项的数组。
questions
用于收集执行操作所需信息的提问。
operations
在回答所有问题后运行的操作。
许可证
MIT 许可证 (MIT)
版权所有 (c) 2017 Cees-Jan Kiewiet
特此授予任何人免费获取本软件及其相关文档文件(“软件”)副本的权利,无论用于何种目的,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本,以及准许向软件提供方提供软件副本的人使用软件的权利,但受以下条件约束
上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。
本软件按“现状”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性保证。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任承担责任,无论该责任是基于合同、侵权或其他原因,无论该责任是否与软件或其使用或其他方式有关。