Skip to content

Commit 49d8cae

Browse files
committed
chore: Update dependencies and enhance build scripts in composer.json and package.json
1 parent 6a46bfe commit 49d8cae

2 files changed

Lines changed: 30 additions & 16 deletions

File tree

composer.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,38 @@
2525
"php-stubs/wordpress-stubs": "^6",
2626
"wp-coding-standards/wpcs": "^3",
2727
"dealerdirect/phpcodesniffer-composer-installer": "^1",
28-
"phpcompatibility/phpcompatibility-wp": "^2",
2928
"yoast/phpunit-polyfills": "^3",
30-
"phpunit/phpunit": "^9.0 || ^10.0 || ^11.0"
29+
"phpunit/phpunit": "^9 || ^10 || ^11 || ^12"
3130
},
3231
"config": {
3332
"allow-plugins": {
3433
"phpstan/extension-installer": true,
3534
"dealerdirect/phpcodesniffer-composer-installer": true
3635
}
3736
},
37+
"minimum-stability": "dev",
38+
"prefer-stable": true,
3839
"scripts": {
39-
"phpcbf": [
40-
"vendor/bin/phpcbf -p -v -s --standard=phpcs.xml.dist $(find . -name '*.php')"
40+
"build:vendor": "composer install --no-dev --optimize-autoloader --classmap-authoritative",
41+
"phpstan": "vendor/bin/phpstan analyse --memory-limit=2048M",
42+
"phpstan-baseline": "vendor/bin/phpstan analyse --memory-limit=2048M --generate-baseline",
43+
"phpcs": "vendor/bin/phpcs -p -v -s --standard=phpcs.xml.dist $(find . -name '*.php')",
44+
"phpcbf": "vendor/bin/phpcbf -p -v -s --standard=phpcs.xml.dist $(find . -name '*.php')",
45+
"phpcompat:setup": [
46+
"@php -r \"if (!is_dir('phpcompat-tools')) { mkdir('phpcompat-tools'); }\"",
47+
"@composer config --working-dir=phpcompat-tools allow-plugins.dealerdirect/phpcodesniffer-composer-installer true 2>/dev/null || true",
48+
"@composer require --working-dir=phpcompat-tools --dev --quiet --no-interaction squizlabs/php_codesniffer:^4.0 phpcompatibility/php-compatibility:dev-develop dealerdirect/phpcodesniffer-composer-installer:^1.0 2>/dev/null || true"
4149
],
42-
"phpcs": [
43-
"vendor/bin/phpcs -p -v -s --standard=phpcs.xml.dist $(find . -name '*.php')"
50+
"phpcompat": [
51+
"@phpcompat:setup",
52+
"phpcompat-tools/vendor/bin/phpcs -p --standard=PHPCompatibility --runtime-set testVersion 7.4-8.5 --extensions=php --ignore=*/vendor/*,*/node_modules/*,*/tests/*,*/phpunit/*,*/freemius/*,*/phpcompat-tools/* ."
4453
],
45-
"phpstan": [
46-
"vendor/bin/phpstan analyse --memory-limit=2048M"
54+
"phpcompat:clean": "rm -rf phpcompat-tools",
55+
"test": [
56+
"@phpcs",
57+
"@phpcompat",
58+
"@phpstan"
4759
],
48-
"phpstan-baseline": [
49-
"vendor/bin/phpstan analyse --memory-limit=2048M --generate-baseline"
50-
]
60+
"zip": "mkdir -p build && zip -X -r build/$(basename $(pwd)).zip . -x '*.git*' 'node_modules/*' '.*' '*/.git*' '*/.DS_Store' 'vendor/**/.DS_Store' 'vendor/bin/*' 'CODE_OF_CONDUCT.md' 'CONTRIBUTING.md' 'ISSUE_TEMPLATE.md' 'PULL_REQUEST_TEMPLATE.md' '*.dist' '*.yml' '*.neon' 'composer.*' 'package.json' 'package-lock.json' 'dev-helpers**' 'build**' 'wporg-assets**' 'test-tools**' 'docs/*' 'phpunit**' 'phpstan-bootstrap.php' 'phpcompat-tools**'"
5161
}
5262
}

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"license": "GPL-2.0-or-later",
77
"main": "index.js",
88
"scripts": {
9+
"build:assets": "node build-assets.js",
910
"build": "wp-scripts build",
1011
"format": "wp-scripts format",
1112
"lint:css": "wp-scripts lint-style",
@@ -26,12 +27,15 @@
2627
"phpstan-baseline.neon"
2728
],
2829
"devDependencies": {
29-
"@wordpress/prettier-config": "^4.18.0",
30-
"@wordpress/scripts": "^30.11.0"
30+
"@wordpress/prettier-config": "^4.40.0",
31+
"@wordpress/scripts": "^31",
32+
"clean-css-cli": "^5.6.3",
33+
"rtlcss": "^4.3.0",
34+
"terser": "^5.46.0"
3135
},
3236
"dependencies": {
33-
"@wordpress/icons": "^10.18.0",
37+
"@wordpress/icons": "^11.7.0",
3438
"clsx": "^2.1.1",
35-
"uuid": "^11.0.5"
39+
"uuid": "^13.0.0"
3640
}
37-
}
41+
}

0 commit comments

Comments
 (0)