inpsyde/boilerplate

此包已废弃且不再维护。未建议替代包。

从头创建新包

0.2.2 2019-01-03 08:51 UTC

README

该工具基于brightnucleus/boilerplate,目的是简化并加速创建新包的过程,适用于日常WordPress工作。它专注于创建类型为wordpress-pluginwordpress-themelibraryproject的composer包,具有默认的目录结构和元文件(如phpunit.xml.distcomposer.json等),但没有任何代码。创建的结构遵循Inpsyde Codex。

使用方法

您只需要至少PHP 5.6和已安装的composer

$ composer create-project inpsyde/boilerplate <DIRECTORY>

composer获取一些依赖后,您将需要回答一些有关新包的问题

> InpsydeBoilerplate\Setup::run
Now running setup tasks...
Task Welcome
  ___                                _
 |_ _| _ __   _ __   ___  _   _   __| |  ___
  | | | '_ \ | '_ \ / __|| | | | / _` | / _ \
  | | | | | || |_) |\__ \| |_| || (_| ||  __/
 |___||_| |_|| .__/ |___/ \__, | \__,_| \___|
             |_|          |___/
  ____          _  _                     _         _
 | __ )   ___  (_)| |  ___  _ __  _ __  | |  __ _ | |_  ___
 |  _ \  / _ \ | || | / _ \| '__|| '_ \ | | / _` || __|/ _ \
 | |_) || (_) || || ||  __/| |   | |_) || || (_| || |_|  __/
 |____/  \___/ |_||_| \___||_|   | .__/ |_| \__,_| \__|\___|
                                 |_|
Task AskAboutProjectParameters
Vendor name [Human readable vendor name (probably your company's name)] Default: "Inpsyde" ?
Vendor name in lowercase [Used in composer package name (no spaces, [a-z0-9-] )] Default: "inpsyde" ?
Package name [Human readable package name] Default: "Awesome Package" ? My new theme
Package name in lowercase [Used for the composer package name (no spaces, [a-z0-9-] )] Default: "my-new-theme" ?
License [License abbreviation [MIT|GPL]] Default: "MIT" ? GPL
Package type [The composer type of the package (library, wordpress-plugin, wordpress-theme or project)] Default: "library" ? wordpress-theme
Package base namespace [The base PHP namespace of the package.] Default: "MyNewTheme" ?
Textdomain [Used for translation in gettext functions] Default: "my-new-theme" ?
Package description [The package description in one sentence] Default: "TODO: Describe what this package is all about" ? This is the description of my new theme
Author name [The name of the author (in person) of the package] Default: "Jane Doe" ? David Naber
Author email [The email of the author.] Default: "hello@inpsyde.com" ? d.naber@inpsyde.com

最后,boilerplate将根据您的输入运行一些脚本以创建所有文件。最后,删除boilerplate的源代码和VCS文件,并初始化一个新的git仓库。

之后,您的目录看起来像这样

$ ls -al <DIRECTORY>
drwxrwxr-x  8 david david   320 Jun 12 17:33 ./
drwxrwxrwt 18 root  root   2440 Jun 12 17:33 ../
drwxrwxr-x  4 david david    80 Jun 12 17:33 assets/
-rw-rw-r--  1 david david   149 Jun 12 17:33 CHANGELOG.md
-rw-rw-r--  1 david david   539 Jun 12 17:33 composer.json
-rw-rw-r--  1 david david   158 Jun 12 17:33 functions.php
drwxrwxr-x  7 david david   200 Jun 12 17:33 .git/
-rw-rw-r--  1 david david    21 Jun 12 17:33 .gitignore
-rw-rw-r--  1 david david 17751 Jun 12 17:33 LICENSE
-rw-rw-r--  1 david david   389 Jun 12 17:33 phpunit.xml.dist
-rw-rw-r--  1 david david   781 Jun 12 17:33 README.md
drwxrwxr-x  2 david david    60 Jun 12 17:33 src/
-rw-rw-r--  1 david david   258 Jun 12 17:33 style.css
drwxrwxr-x  3 david david    60 Jun 12 17:33 tests/
drwxrwxr-x  3 david david    80 Jun 12 17:33 vendor/
drwxrwxr-x  2 david david    60 Jun 12 17:33 w-org-assets/

目录结构取决于您选择的包类型。例如,对于libraryproject类型,将不会出现w-org-assets/目录。

致谢

此包建立在brightnucleus/boilerplate包之上,由Alain Schlesser创建。

由Inpsyde制作

Inpsyde团队自2006年以来一直在进行Web工程。

许可证

版权(c)2016 Inpsyde GmbH

好消息,此插件对每个人都是免费的!由于它是在MIT许可证下发布的,因此您可以在个人或商业网站上免费使用它。

贡献

欢迎所有反馈/错误报告/拉取请求。但请注意,此包是用于Inpsyde的日常工作的。