Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

23 changes: 12 additions & 11 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
/php/Tests/
/assets/
/dist/
/scripts/
/js/src/
/js/
/node_modules/
/.vagrant/
/assets/
gruntfile.js
/tools/
/tests/
/wordpress/
/wp-content/
/.cache/
composer.json
composer.lock
docker-compose.yaml
package.json
package-lock.json
phpcs.*
phpunit.*
phpcs.xml
phpcs.xml.dist
phpstan.neon
phpunit.xml
phpunit.xml.dist
readme.md
readme.txt.md
Vagrantfile
webpack.config.js
*.log
.*
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/node_modules
/vendor
/.vagrant
/console.log
/build
/dist
/.cache
/tests/coverage

.phpunit.result.cache
phpcs.xml
phpunit.xml
.DS_Store
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cache=.cache/node
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"testsEnvironment": false,
"phpVersion": "7.4",
"core": "./tools/wordpress",
"mappings": {
"wp-content": "./tools/wp-content",
"wp-content/plugins/block-context": "."
},
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": true,
"SCRIPT_DEBUG": true
}
}
10 changes: 0 additions & 10 deletions Vagrantfile

This file was deleted.

8 changes: 7 additions & 1 deletion block-context.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
* Version: 0.1.0
* Author: Kaspars Dambis
* Author URI: https://kaspars.net
* Requires PHP: 7.4
* Text Domain: block-context
*/

namespace Preseto\BlockContext;

// Ensure WP core is loaded.
if ( ! function_exists( 'add_action' ) ) {
return;
}

// Support for site-level autoloading.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
if ( ! class_exists( BlockContextPlugin::class ) && file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}

Expand Down
145 changes: 81 additions & 64 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,83 @@
{
"name": "preseto/block-context",
"description": "WordPress plugin for showing or hiding Gutenberg blocks depending on context.",
"homepage": "https://blockcontext.com",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Kaspars Dambis",
"homepage": "https://preseto.com"
}
],
"support": {
"issues": "https://github.com/preseto/block-context/issues",
"source": "https://github.com/preseto/block-context"
},
"require": {
},
"require-dev": {
"wp-coding-standards/wpcs": "^1.2",
"10up/wp_mock": "^0.3.0",
"wpsh/local": "^0.1.1",
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"autoload": {
"psr-4": {
"Preseto\\BlockContext\\": "php/"
}
},
"autoload-dev": {
"psr-4": {
"Preseto\\BlockContextTests\\": "php/Tests/"
}
},
"config": {
"autoloader-suffix": "PresetoBlockContext"
},
"scripts": {
"build": [
"@composer validate --no-check-publish --strict",
"@composer install --no-dev --prefer-dist --optimize-autoloader --no-scripts"
],
"lint-php": [
"./vendor/bin/phpcs ."
],
"lint": [
"@lint-php"
],
"test-php": [
"./vendor/bin/phpunit"
],
"test": [
"@test-php"
],
"test-report": [
"vendor/bin/php-coveralls -v"
],
"post-install-cmd": [
"npm install"
],
"post-update-cmd": [
"npm install"
]
}
"name": "preseto/block-context",
"description": "WordPress plugin for showing or hiding Gutenberg blocks depending on context.",
"homepage": "https://blockcontext.com",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Kaspars Dambis",
"homepage": "https://preseto.com"
}
],
"support": {
"issues": "https://github.com/preseto/block-context/issues",
"source": "https://github.com/preseto/block-context"
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org",
"only": [
"wpackagist-plugin/*",
"wpackagist-theme/*"
]
}
],
"config": {
"platform": {
"php": "7.4"
},
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"roots/wordpress-core-installer": true
}
},
"extra": {
"wordpress-install-dir": "tools/wordpress",
"installer-paths": {
"tools/wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
],
"tools/wp-content/themes/{$name}/": [
"type:wordpress-theme"
]
}
},
"require-dev": {
"phpcompatibility/phpcompatibility-wp": "^3.0",
"phpstan/phpstan": "^2.2",
"phpunit/phpunit": "^9.6",
"roots/wordpress": "^7.0",
"roots/wordpress-core-installer": "^4.0",
"wp-cli/wp-cli-bundle": "^2.12",
"wp-coding-standards/wpcs": "^3.3",
"wp-phpunit/wp-phpunit": "^7.0",
"wpackagist-plugin/query-monitor": "^4.0",
"wpackagist-theme/twentytwentyfive": "^1.5",
"yoast/phpunit-polyfills": "^4.0"
},
"autoload": {
"psr-4": {
"Preseto\\BlockContext\\": "php/"
}
},
"scripts": {
"test": "phpunit",
"lint": [
"@lint:phpcs",
"@lint:phpstan"
],
"lint:phpcs": "phpcs",
"lint:phpstan": "phpstan --memory-limit=4G",
"format": [
"@format:phpcs"
],
"format:phpcs": "phpcbf",
"wp": "wp"
}
}
Loading