-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcomposer.json
182 lines (182 loc) · 8.49 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
172
173
174
175
176
177
178
179
180
181
182
{
"name": "brianhenryie/bh-wp-logger",
"description": "A PSR logger for WordPress plugins, with a nice WP_List_Table UI.",
"type": "library",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Brian Henry",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
},
"platform": {
"php": "7.4"
},
"process-timeout": 0,
"sort-packages": true
},
"autoload": {
"classmap": [
"src/",
"assets"
]
},
"autoload-dev": {
"classmap": [
"test-plugin/"
]
},
"repositories": {
"brianhenryie/composer-phpstorm": {
"url": "https://github.com/BrianHenryIE/composer-phpstorm",
"type": "git"
},
"outlandishideas/wpackagist": {
"type": "composer",
"url": "https://wpackagist.org"
},
"wordpress/wordpress": {
"url": "https://github.com/WordPress/wordpress-develop",
"type": "git"
}
},
"require": {
"php": ">=7.4",
"ext-json": "*",
"brianhenryie/bh-wp-private-uploads": "^0.1.1",
"brianhenryie/bh-wc-logger": "^0.1.0",
"brianhenryie/bh-wp-cli-logger": "^1.0",
"katzgrau/klogger": "dev-master",
"psr/log": "^1.0",
"wptrt/admin-notices": "^1.0"
},
"require-dev": {
"10up/wp_mock": "^1.0",
"antecedent/patchwork": "^2.1",
"alleyinteractive/wordpress-autoloader": "^1.1",
"brianhenryie/color-logger": "^1.0",
"codeception/module-asserts": "*",
"codeception/module-cli": "*",
"codeception/module-db": "*",
"codeception/module-filesystem": "*",
"codeception/module-phpbrowser": "*",
"codeception/module-webdriver": "*",
"codeception/util-universalframework": "*",
"cweagans/composer-patches": "*",
"jaschilz/php-coverage-badger": "^2.0",
"kporras07/composer-symlinks": "dev-master",
"lucatume/wp-browser": "^3.0",
"php-stubs/woocommerce-stubs": "*",
"phpcompatibility/phpcompatibility-wp": "*",
"phpstan/extension-installer": "*",
"phpunit/phpcov": "*",
"squizlabs/php_codesniffer": "^3.7",
"szepeviktor/phpstan-wordpress": "^1.3",
"woocommerce/woocommerce-sniffs": "*",
"wordpress/wordpress": "*",
"wp-cli/wp-cli-bundle": "*",
"wp-coding-standards/wpcs": "^3.0",
"wpackagist-theme/twentytwenty": "*",
"wpackagist-plugin/woocommerce": "*"
},
"extra": {
"patches": {
"jaschilz/php-coverage-badger": {
"Allow customising the text": "https://github.com/JASchilz/PHPCoverageBadge/pull/1.patch"
}
},
"symlinks": {
"wp-content": "wordpress/wp-content",
"test-plugin": "wp-content/plugins/bh-wp-logger-test-plugin",
"src": "test-plugin/vendor/brianhenryie/bh-wp-logger/src",
"assets": "test-plugin/vendor/brianhenryie/bh-wp-logger/assets",
"vendor/brianhenryie/bh-wp-private-uploads/src": "test-plugin/vendor/brianhenryie/bh-wp-private-uploads/src",
"vendor/brianhenryie/bh-wc-logger/src": "test-plugin/vendor/brianhenryie/bh-wc-logger/src",
"vendor/brianhenryie/bh-wp-cli-logger/src": "test-plugin/vendor/brianhenryie/bh-wp-cli-logger/src",
"vendor/brianhenryie/bh-wp-private-uploads/assets": "test-plugin/vendor/brianhenryie/bh-wp-private-uploads/assets",
"vendor/wptrt/admin-notices/src": "test-plugin/vendor/wptrt/admin-notices/src"
},
"phpstorm": {
"exclude_folders": {
"folders": [
"vendor/php-stubs/woocommerce-stubs",
"vendor/wordpress/wordpress/src",
"vendor/wordpress/wordpress/build",
"wp-content/plugins/bh-wp-logger-test-plugin",
"wordpress/wp-content"
],
"include_folders": [
"vendor/wordpress/wordpress/"
],
"composer-symlinks": false
}
}
},
"scripts": {
"post-install-cmd": [
"vendor/bin/wp core download --path=wordpress --allow-root || true;",
"@create-symlinks",
"@setup-wordpress",
"BrianHenryIE\\ComposerPhpStorm\\ExcludeFolders::update",
"BrianHenryIE\\ComposerPhpStorm\\PHPUnitRunConfigurations::update"
],
"post-update-cmd": [
"@setup-wordpress",
"@create-symlinks",
"BrianHenryIE\\ComposerPhpStorm\\ExcludeFolders::update",
"BrianHenryIE\\ComposerPhpStorm\\PHPUnitRunConfigurations::update"
],
"create-symlinks": [
"Kporras07\\ComposerSymlinks\\ScriptHandler::createSymlinks"
],
"setup-wordpress": [
"wp core download --path=wordpress --allow-root || true",
"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",
"wp config set WP_DEBUG true --raw; wp config set WP_DEBUG_LOG true --raw; wp config set SCRIPT_DEBUG true --raw; wp config set DISABLE_WP_CRON true --raw;",
"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 user create bob [email protected] --user_pass=password || true;",
"wp core update --allow-root || true",
"mkdir -p wordpress/wp-content/uploads"
],
"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); mysql -e \"DROP TABLE IF EXISTS $TEST_SITE_DB_NAME;\" mysql -e \"DROP TABLE IF EXISTS $TEST_DB_NAME;\"",
"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;",
"mysql -e \"FLUSH TABLES;\""
],
"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 2G"
],
"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 2G"
]
}
}