wpdesk / wp-wpdesk-composer
Requires
- php: >=7.2 || ^8
- composer-plugin-api: ^2
- ext-json: *
- jetbrains/phpstorm-stubs: *
- matthiasmullie/minify: ^1.3
- php-stubs/woocommerce-stubs: *
- php-stubs/wordpress-stubs: *
- sniccowp/php-scoper-wordpress-excludes: *
- symfony/filesystem: ^5.4 || ^6.4 || ^7.1
- wp-cli/wp-cli: ~2.7
- wp-cli/wp-cli-bundle: ~2.7
- wpdesk/php-scoper-woocommerce-excludes: *
- wpdesk/wp-code-sniffer: ^1.1
Requires (Dev)
- 10up/wp_mock: ^1
- composer/composer: ^2
- phpunit/phpunit: <10
- dev-master
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-beta.2
- 3.0.0-beta.1
- 2.27.1
- 2.27.0
- 2.26.0
- 2.25.1
- 2.25.1-beta1
- 2.25.0
- 2.24.2
- 2.24.1
- 2.24.0
- 2.23.1
- 2.23.0
- 2.22.1
- 2.22.0
- 2.21.3
- 2.21.2
- 2.21.1
- 2.21.0
- 2.20.2
- 2.20.1
- 2.20.0
- 2.20.0-beta1
- 2.19.0
- 2.18.0
- 2.18.0-beta3
- 2.18.0-beta2
- 2.18.0-beta1
- 2.17.10
- 2.17.9
- 2.17.8
- 2.17.7
- 2.17.6
- 2.17.5
- 2.17.4
- 2.17.3
- 2.17.2
- 2.17.1
- 2.17.0
- 2.16.0
- 2.15.2
- 2.15.1
- 2.15.0
- 2.14.7
- 2.14.6
- 2.14.6-beta2
- 2.14.6-beta1
- 2.14.5
- 2.14.4
- 2.14.3
- 2.14.2
- 2.14.1
- 2.14.0
- 2.13.1
- 2.13.0
- 2.12.3
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.0
- 2.10.5
- 2.10.4
- 2.10.3
- 2.10.2
- 2.10.1
- 2.10.0
- 2.10.0-beta7
- 2.10.0-beta6
- 2.10.0-beta5
- 2.10.0-beta4
- 2.10.0-beta3
- 2.10.0-beta2
- 2.10.0-beta1
- 2.9.9
- 2.9.8
- 2.9.7
- 2.9.6
- 2.9.5
- 2.9.4
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.9.0-beta2
- 2.9.0-beta1
- 2.8.12
- 2.8.11
- 2.8.10
- 2.8.9
- 2.8.8
- 2.8.8-beta
- 2.8.7
- 2.8.6
- 2.8.5
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.8.0-beta5
- 2.8.0-beta4
- 2.8.0-beta3
- 2.8.0-beta2
- 2.8.0-beta1
- 2.7.1
- 2.7.0
- 2.6.5-beta2
- 2.6.5-beta1
- 2.6.4
- 2.6.3
- 2.6.1
- 2.6.0
- 2.5.2
- 2.5.2-beta5
- 2.5.2-beta4
- 2.5.2-beta3
- 2.5.2-beta2
- 2.5.2-beta1
- 2.5.1-beta1
- 2.5.0
- 2.4.9
- 2.4.8
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.1
- 2.0
- 1.2.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0
- dev-feat/v3
- dev-feat/wp-rc-version
- dev-feat/new-l10n-format
- dev-newer-stubs
- dev-refactor/rewrite-translation-script
- dev-bugfix/downgrade-psr-container
- dev-ditch-hooks
- dev-upgrade-libraries
- dev-fix/generate-pot
- dev-bugfix/tests
- dev-fix/pot
- dev-revert-1834107f
- dev-fix/7.3required
- dev-feature/director-upgrade
- dev-feature/composer2
- dev-feature/composer-2
- dev-feature/php8
- dev-devel
- dev-feature/wp-requires-version
- dev-feature/dwukropek-removed
- dev-feature/cache-interop
This package is auto-updated.
Last update: 2024-10-26 10:29:27 UTC
README
Installation
composer require --dev wpdesk/wp-wpdesk-composer composer require --dev wpdesk/wp-plugin-flow ^2.0
Usage
Add to composer.json
to scripts section:
"tests-unit": "docker-compose -f vendor/wpdesk/wp-wpdesk-composer/docker/docker-compose.yaml run wordpress phpunit --no-coverage -c /opt/project/phpunit-unit.xml",
"tests-integration": "docker-compose -f vendor/wpdesk/wp-wpdesk-composer/docker/docker-compose.yaml run wordpress phpunit --no-coverage -c /opt/project/phpunit-integration.xml",
"tests": [
"@composer tests-unit",
"@composer tests-integration"
]
To run scripts type in command line:
- Set plugin date in plugin file:
composer set-plugin-date
- To set plugin contributors:
composer set-contributors
- To set WordPress tested up version number:
composer replace-tested-up-wp
- To set WordPress requires at least version number:
composer replace-requires-at-least-wp
- To set WooCommerce tested up version number:
composer replace-tested-up-wc
- To set WooCommerce requires at least version number:
composer replace-requires-at-least-wc
- To set PHP requires version number:
composer replace-requires-php
- To run commands 1-4:
composer set-plugin-data
- To run unit tests:
composer run-unit-tests
orcomposer run-unit-tests fast
- To run integration tests:
composer run-integration-tests
orcomposer run-integration-tests
- To generate .pot files:
composer generate-pot
- To merge translations:
composer merge-translations
- To minify assets
composer minify-assets
- To generate release folder and zip:
composer generate-plugin-release
- To increase plugin versions:
composer increase-plugin-version composer increase-plugin-version --minor composer increase-plugin-version --major
Translations
Configuration for language commands ( composer generate-pot
, composer merge-translations
) must be entered in composer.json file in extra
.
Example configuration:
"extra" : {
"text-domain": "flexible-shipping",
"translations-folder": "lang",
"po-files": {
"pl_PL": "pl_PL.po"
}
}
text-domain
: plugin/library text domain
translations-folder
: folder, where translations are stored
po-files
: translations files
Minification
Configuration for assets minification ( composer minify-assets
) must be entered in composer.json file in extra
.
Example configuration:
"extra": {
"minify-assets" : {
"js" : [
"assets/js/admin.js",
"assets/js/admin_order.js",
"assets/js/admin_settings.js",
"assets/js/checkout.js",
"assets/js/i18n-support.js"
],
"css" : [
"assets/css/admin.css",
"assets/css/checkout.css"
]
}
}
Additional
To regenerate WooCommerce stubs use ../vendor/wpdesk/wp-wpdesk-composer/director/vendor/szepeviktor/phpstan-wordpress/stub-generators/wc-generate-stubs.sh in WooCommerce dir.
Faker
Faker can fake libraries in vendor_prefixed libraries. Faker can change files content, files names and folder names.
Configuration for faker must be entered in composer.json file in extra
.
Faker runs right after prefixer.
Example configuration:
"extra": {
"fake-vendor-prefixed": {
"path": "wpdesk",
"fake-path": "octolize",
"content": {
"wpdesk": "octolize",
"WPDesk": "Octolize"
},
"file-names": {
"WPDesk": "Octolize",
"wpdesk": "octolize"
},
"folder-names": {
"wpdesk": "octolize",
"WPDesk": "Octolize"
}
}
}
path
- namespace (subfolder) in vendor_prefixed
fake-path
- new namespace, can be blank
content
- array of strings to find and replace in content
file-names
- array of strings to find and replace in file names
folder-names
- array of string to find and replace in folder names