forked from BrianHenryIE/WordPress-Plugin-Boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomposer.json
171 lines (171 loc) · 7.96 KB
/
composer.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
"name": "PHP_Package_Name",
"description": "This is a short description of what plugin_title does.",
"type": "wordpress-plugin",
"license": "GPL-2.0+-or-later",
"authors": [
{
"name": "Your Name",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"process-timeout": 0,
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"johnpbloch/wordpress-core-installer": true,
"phpstan/extension-installer": true
}
},
"autoload-dev": {
"psr-4": {
"Plugin_Package_Name\\": ["tests/integration","tests/unit","tests/wpunit"]
}
},
"repositories": {
"brianhenryie/composer-phpstorm": {
"url": "https://github.com/BrianHenryIE/composer-phpstorm",
"type": "git"
},
"composer/composer": {
"type": "composer",
"url": "https://wpackagist.org"
},
"wordpress/wordpress": {
"url": "https://github.com/WordPress/wordpress-develop",
"type": "git"
}
},
"require": {
"php": ">=7.4",
"alleyinteractive/wordpress-autoloader": "^1.1"
},
"require-dev": {
"10up/wp_mock": "*",
"antecedent/patchwork": "^2.1",
"brianhenryie/color-logger": "^1.0",
"brianhenryie/composer-phpstorm": "dev-master",
"brianhenryie/strauss": "*",
"codeception/module-asserts": "^1.0",
"codeception/module-cli": "^1.0",
"codeception/module-db": "^1.0.0",
"codeception/module-filesystem": "^1.0",
"codeception/module-phpbrowser": "^1.0.0",
"codeception/module-webdriver": "^1.0",
"codeception/util-universalframework": "^1.0",
"cweagans/composer-patches": "*",
"dealerdirect/phpcodesniffer-composer-installer": "*",
"jaschilz/php-coverage-badger": "^2.0",
"johnpbloch/wordpress": "*",
"kporras07/composer-symlinks": "dev-master",
"lucatume/wp-browser": "*",
"phpcompatibility/phpcompatibility-wp": "*",
"phpstan/extension-installer": "*",
"phpunit/phpcov": "*",
"squizlabs/php_codesniffer": "*",
"szepeviktor/phpstan-wordpress": "*",
"wordpress/wordpress": "*",
"wp-cli/dist-archive-command": "dev-main",
"wp-cli/i18n-command": "^2.4",
"wp-cli/wp-cli-bundle": "*",
"wp-coding-standards/wpcs": "*",
"wpackagist-theme/twentytwenty": "*"
},
"extra": {
"patches": {
"jaschilz/php-coverage-badger": {
"Allow customising the text": "https://github.com/JASchilz/PHPCoverageBadge/pull/1.patch"
},
"wp-cli/dist-archive-command": {
"Add Increment Version": "https://github.com/BrianHenryIE/dist-archive-command/commit/f37c375ba8069c9160d642dd0c00435e0f1c4804.patch"
}
},
"strauss": {
"namespace_prefix": "Plugin_Package_Name\\",
"classmap_prefix": "Plugin_Snake_"
},
"symlinks": {
"wp-content": "wordpress/wp-content",
".": "wp-content/plugins/plugin-slug"
},
"phpstorm": {
"exclude_folders": {
"folders": [
"vendor/php-stubs/woocommerce-stubs",
"vendor/wordpress/wordpress/src",
"vendor/wordpress/wordpress/build",
"wp-content/plugins/plugin-slug",
"wordpress/wp-content"
],
"composer-symlinks": false
}
}
},
"scripts": {
"post-install-cmd": [
"vendor/bin/strauss",
"vendor/bin/wp core download --path=wordpress --allow-root || true;",
"Kporras07\\ComposerSymlinks\\ScriptHandler::createSymlinks",
"@setup-wordpress",
"BrianHenryIE\\ComposerPhpStorm\\ExcludeFolders::update",
"BrianHenryIE\\ComposerPhpStorm\\PHPUnitRunConfigurations::update"
],
"post-update-cmd": [
"vendor/bin/strauss",
"@setup-wordpress",
"Kporras07\\ComposerSymlinks\\ScriptHandler::createSymlinks",
"BrianHenryIE\\ComposerPhpStorm\\ExcludeFolders::update",
"BrianHenryIE\\ComposerPhpStorm\\PHPUnitRunConfigurations::update"
],
"setup-wordpress": [
"export $(grep -v '^#' .env.testing | xargs); wp config create --dbname=$TEST_SITE_DB_NAME --dbuser=$TEST_SITE_DB_USER --dbpass=$TEST_SITE_DB_PASSWORD --allow-root || true",
"export $(grep -v '^#' .env.testing | xargs); vendor/bin/wp core install --url=\"localhost:8080/$PLUGIN_SLUG\" --title=\"$PLUGIN_NAME\" --admin_user=admin --admin_password=password [email protected] || true; wp plugin activate $PLUGIN_SLUG || true;",
"wp config set WP_DEBUG true --raw; wp config set WP_DEBUG_LOG true --raw; wp config set SCRIPT_DEBUG true --raw",
"wp user create bob [email protected] --user_pass=password || true;"
],
"create-databases": [
"export $(grep -v '^#' .env.testing | xargs); [[ $(mysqld --version) =~ .*MariaDB.* ]] && mysql -e \"CREATE USER IF NOT EXISTS '\"$TEST_DB_USER\"'@'%' IDENTIFIED BY '\"$TEST_DB_PASSWORD\"';\" || mysql -e \"CREATE USER IF NOT EXISTS '\"$TEST_DB_USER\"'@'%' IDENTIFIED WITH mysql_native_password BY '\"$TEST_DB_PASSWORD\"';\";",
"export $(grep -v '^#' .env.testing | xargs); mysql -e \"CREATE DATABASE IF NOT EXISTS \"$TEST_SITE_DB_NAME\"; USE \"$TEST_SITE_DB_NAME\"; GRANT ALL PRIVILEGES ON \"$TEST_SITE_DB_NAME\".* TO '\"$TEST_DB_USER\"'@'%';\";",
"export $(grep -v '^#' .env.testing | xargs); mysql -e \"CREATE DATABASE IF NOT EXISTS \"$TEST_DB_NAME\"; USE \"$TEST_DB_NAME\"; GRANT ALL PRIVILEGES ON \"$TEST_DB_NAME\".* TO '\"$TEST_DB_USER\"'@'%';\";",
"@restore-acceptance-database"
],
"delete-databases": [
"export $(grep -v '^#' .env.testing | xargs); DB_DIR=$(mysql -e \"select @@datadir\" -N -B); rm -rf $DB_DIR$TEST_SITE_DB_NAME; rm -rf $DB_DIR$TEST_DB_NAME;"
],
"save-acceptance-database": [
"export $(grep -v '^#' .env.testing | xargs); mysqldump -u $TEST_SITE_DB_USER -p$TEST_SITE_DB_PASSWORD $TEST_SITE_DB_NAME > tests/_data/dump.sql;"
],
"restore-acceptance-database": [
"export $(grep -v '^#' .env.testing | xargs); mysql $TEST_SITE_DB_NAME < tests/_data/dump.sql"
],
"coverage-tests": [
"vendor/bin/codecept run unit --coverage unit.cov",
"vendor/bin/codecept run wpunit --coverage wpunit.cov",
"vendor/bin/phpcov merge --clover tests/_output/clover.xml --html tests/_output/html tests/_output;",
"open tests/_output/html/index.html"
],
"lint": [
"vendor/bin/phpcbf || true",
"vendor/bin/phpcs || true",
"vendor/bin/phpstan analyse --memory-limit 1G"
],
"lint-changes": [
"updated_files=$( git status | grep 'modified:\\s.*.php$' | cut -c14- | awk '{ printf(\"%s \", $0) }' ); vendor/bin/phpcbf $(echo $updated_files); vendor/bin/phpcs $(echo $updated_files); vendor/bin/phpstan analyse $(echo $updated_files) --memory-limit 1G"
],
"php-compatibility": [
"vendor/bin/phpcs -p src templates vendor-prefixed --standard=PHPCompatibilityWP --runtime-set testVersion 7.4-"
],
"create-plugin-archive": [
"vendor/bin/wp i18n make-pot src languages/$(basename \"$PWD\").pot --domain=$(basename \"$PWD\")",
"vendor/bin/wp dist-archive . ./dist-archive --plugin-dirname=$(basename \"$PWD\") --create-target-dir"
],
"github-actions": [
"act -P ubuntu-latest=shivammathur/node:latest"
]
}
}