Skip to content

Commit

Permalink
Merge branch 'develop' into feature/Notifications-table/CU-3mp4ad
Browse files Browse the repository at this point in the history
# Conflicts:
#	phpstan.neon.dist
  • Loading branch information
jakubmikita committed May 6, 2024
2 parents e140ff4 + ed5a2ed commit e2e31db
Show file tree
Hide file tree
Showing 89 changed files with 9,785 additions and 9,857 deletions.
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,19 @@
*.tiff binary
*.ico binary
*.svg text
/.github/ export-ignore
/.wordpress-org/ export-ignore
/tests/ export-ignore
/.build-excludes export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/CONTRIBUTING.md export-ignore
/composer.lock export-ignore
/phpcs.xml export-ignore
/phpmd.xml export-ignore
/phpunit.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/webpack.config.js export-ignore
/yarn.lock export-ignore
27 changes: 12 additions & 15 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,22 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '7.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install Node dependencies
uses: bahmutov/npm-install@v1
- name: Install Strauss globally
run: composer global require brianhenryie/strauss
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Install Composer build dependencies
run: composer bin build install --no-progress
- name: Compose dependencies
run: composer compose
- name: Remove dev depencencies
run: |
rm -rf vendor
composer install --no-dev --no-progress
with:
composer-options: "--no-dev"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '16'
cache: yarn
- name: Install yarn dependencies
run: yarn install --immutable
- name: Build static assets
run: yarn build
- name: Create build dir
Expand Down
27 changes: 12 additions & 15 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,22 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '7.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install Node dependencies
uses: bahmutov/npm-install@v1
- name: Install Strauss globally
run: composer global require brianhenryie/strauss
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Install Composer build dependencies
run: composer bin build install --no-progress
- name: Compose dependencies
run: composer compose
- name: Remove dev depencencies
run: |
rm -rf vendor
composer install --no-dev --no-progress
with:
composer-options: "--no-dev"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '16'
cache: yarn
- name: Install yarn dependencies
run: yarn install --immutable
- name: Build static assets
run: yarn build:production
- name: Create build dir
Expand Down
82 changes: 35 additions & 47 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ jobs:
phpcs:
name: PHP Coding Standards
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
Expand All @@ -22,94 +25,78 @@ jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Install Composer build dependencies
run: composer bin build install --no-progress
- name: Compose dependencies
run: composer compose
- name: Analyze
run: composer phpstan
phplint:
name: PHP Lint
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Install Composer build dependencies
run: composer bin build install --no-progress
- name: Compose dependencies
run: composer compose
- name: Lint
run: composer phplint
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.2']
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Checkout
uses: actions/checkout@v2
- name: Set Composer version
run: composer self-update --2.2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '16'
cache: yarn
- name: Install yarn dependencies
run: yarn install --immutable
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Install Composer build dependencies
run: composer bin build install --no-progress
- name: Compose dependencies
run: composer compose
- name: Remove unused dependencies
run: composer remove --dev szepeviktor/phpstan-wordpress
- name: Setup tests
run: bash tests/bin/install-wp-tests.sh
- name: Setup PHP ${{ matrix.php }}
# https://github.com/shivammathur/setup-php/issues/446#issuecomment-824001225
uses: shivammathur/setup-php@develop
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
tools: none
- name: PHPUnit
- name: Start wp-env
env:
WP_DB_HOST: 127.0.0.1:${{ job.services.mysql.ports['3306'] }}
run: composer test
WP_ENV_PHP_VERSION: ${{ matrix.php }}
run: yarn run wp-env start
- name: Run Tests
run: yarn run test-php
css:
name: CSS Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '12'
- name: Install Node dependencies
uses: bahmutov/npm-install@v1
node-version: '16'
cache: yarn
- name: Install yarn dependencies
run: yarn install --immutable
- name: CSS lint
run: yarn lint:css
js:
Expand All @@ -119,10 +106,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '12'
- name: Install Node dependencies
uses: bahmutov/npm-install@v1
node-version: '16'
cache: yarn
- name: Install yarn dependencies
run: yarn install --immutable
- name: JS lint
run: yarn lint:js
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ node_modules/
/vendor/
package-lock.json
/resources/*/dist/
/src/Dependencies/
/dependencies/
/tests/_wordpress/
/vendor-bin/**/vendor/

Expand Down
4 changes: 4 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies/**/*
node_modules/**/*
vendor/**/*
resources/css/dist/**/*
6 changes: 6 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"phpVersion": "7.4",
"mappings": {
"wp-content/plugins/notification": "."
}
}
2 changes: 1 addition & 1 deletion compat/src-deprecated/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function notification_display_wizard() {
function notification_ajax_handler() {
_deprecated_function( __FUNCTION__, '8.0.0' );

return new BracketSpace\Notification\Dependencies\Micropackage\Ajax\Response();
return new \BracketSpace\Notification\Dependencies\Micropackage\Ajax\Response();
}

/**
Expand Down
39 changes: 23 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"micropackage/templates": "^1.1"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
"brain/monkey": "^2.6",
"brianhenryie/strauss": "^0.17.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"pestphp/pest": "^1.23",
"php-parallel-lint/php-parallel-lint": "^1.3",
Expand All @@ -36,21 +36,13 @@
"allow-plugins": true,
"platform-check": false
},
"extra": {
"mozart": {
"dep_namespace": "BracketSpace\\Notification\\Dependencies\\",
"dep_directory": "/src/Dependencies/",
"classmap_directory": "/classes/dependencies/",
"classmap_prefix": "BRSET_",
"delete_vendor_directories": true
}
},
"autoload": {
"psr-4": {
"BracketSpace\\Notification\\": "src/"
},
"classmap": [
"compat/src-deprecated/"
"compat/src-deprecated/",
"dependencies/"
],
"files": [
"compat/src-deprecated/functions.php",
Expand All @@ -63,12 +55,27 @@
"Tests\\": "tests/"
}
},
"extra": {
"strauss": {
"namespace_prefix": "BracketSpace\\Notification\\Dependencies\\",
"target_directory": "dependencies",
"classmap_prefix": "BRSET_"
}
},
"scripts": {
"compose": "mozart compose && composer dump-autoload",
"phpcbf": "phpcbf",
"phpcs": "phpcs",
"phplint": "parallel-lint --exclude node_modules --exclude vendor --exclude vendor-bin .",
"phpcbf": "phpcbf --parallel=4",
"phpcs": "phpcs --parallel=4",
"phplint": "parallel-lint --exclude node_modules --exclude vendor .",
"phpstan": "phpstan analyze --memory-limit=-1",
"test": "vendor/bin/pest"
"prefix-namespaces": [
"strauss",
"composer dump-autoload"
],
"post-install-cmd": [
"@prefix-namespaces"
],
"post-update-cmd": [
"@prefix-namespaces"
]
}
}
Loading

0 comments on commit e2e31db

Please sign in to comment.