diff --git a/.gitignore b/.gitignore index b76e0ebd8..994a4686a 100644 --- a/.gitignore +++ b/.gitignore @@ -105,7 +105,6 @@ node_modules # Composer vendor -cghooks.lock # Tests tests/data/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ad60817b..b4f626bc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ ## Changelog # -### 1.5.2 – 2019-12-02 ### +### 1.5.3 – 2020-01-20 ### + +Some UI improvements, bugfixes, and improved stability. + +* Fix: Improved import error feedback, and cleaner methods +* Fix: Editor bug from `@wordpress/nux` package being deprecated +* New: Improved stability, including JS tests and query limit +* New: Pre-commit hook to lint only staged files + +### 1.5.2 – 2020-02-04 ### Some small tweaks to the Block Importer and onboarding dialogs. diff --git a/README.md b/README.md index 3326fb4ab..12be81291 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Block Lab # Contributors: lukecarbis, ryankienstra, Stino11, rheinardkorf -Tags: Gutenberg, Blocks +Tags: gutenberg, blocks, block editor, fields, template Requires at least: 5.0 Tested up to: 5.3 Requires PHP: 5.6 @@ -51,7 +51,7 @@ Block Lab Pro is here, with powerful features to take your block building to the ### Manually ### * Clone Block Lab into a working directory with `https://github.com/getblocklab/block-lab.git` -* `cd` into the `block-lab` directory, and run `npm install` +* `cd` into the `block-lab` directory, and run `npm install && composer install` * Next, build the scripts and styles with `npm build` * Move the `block-lab` folder to your `/wp-content/plugins/` directory * Activate the Block Lab plugin through the Plugins menu in WordPress diff --git a/bin/pre-commit.sh b/bin/pre-commit.sh index 994815eb0..6ecdf7170 100644 --- a/bin/pre-commit.sh +++ b/bin/pre-commit.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # Lint staged PHP files php_files=$( git diff --diff-filter=d --staged --name-only | grep -E '/*\.php$' ) if [ ! -z "$php_files" ]; then @@ -15,3 +17,6 @@ if [ ! -z "$js_files" ]; then exit 1 fi fi + +# Lint package.json +npm run lint:pkg-json diff --git a/block-lab.php b/block-lab.php index 200903c07..af0986b0f 100644 --- a/block-lab.php +++ b/block-lab.php @@ -9,7 +9,7 @@ * Plugin Name: Block Lab * Plugin URI: https://getblocklab.com * Description: The easy way to build custom blocks for Gutenberg. - * Version: 1.5.2 + * Version: 1.5.3 * Author: Block Lab * Author URI: https://getblocklab.com * License: GPL2 diff --git a/composer.json b/composer.json index 304502135..ecb3e9d0d 100644 --- a/composer.json +++ b/composer.json @@ -9,20 +9,10 @@ }, "require-dev": { "brain/monkey": "^2", - "brainmaestro/composer-git-hooks": "^2.8", "dealerdirect/phpcodesniffer-composer-installer": "0.5.0", "mockery/mockery": "^1.2.4", "phpcompatibility/phpcompatibility-wp": "2.1.0", "squizlabs/php_codesniffer": "^3.4", "wp-coding-standards/wpcs": "2.2.0" - }, - "extra": { - "hooks": { - "pre-commit": "bash bin/pre-commit.sh" - } - }, - "scripts": { - "post-install-cmd": "cghooks add --ignore-lock", - "post-update-cmd": "cghooks update" } } diff --git a/gulpfile.js b/gulpfile.js index 06c1f1c98..218a6110c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -88,11 +88,13 @@ gulp.task( 'clean:bundle', function () { 'package/trunk/Makefile', 'package/trunk/package*.json', 'package/trunk/phpunit.xml', + 'package/trunk/phpcs.xml', 'package/trunk/README.md', 'package/trunk/CHANGELOG.md', + 'package/trunk/CODE_OF_CONDUCT.md', + 'package/trunk/CONTRIBUTING.md', 'package/trunk/webpack.config.js', 'package/trunk/.github', - 'package/trunk/cghooks.lock', 'package/prepare', ] ); } ); diff --git a/js/blocks/helpers/test/registerBlocks.js b/js/blocks/helpers/test/registerBlocks.js index 86acb3eed..80ec8fc40 100644 --- a/js/blocks/helpers/test/registerBlocks.js +++ b/js/blocks/helpers/test/registerBlocks.js @@ -1,4 +1,3 @@ - /** * Internal dependencies */ diff --git a/package-lock.json b/package-lock.json index 1112e0962..84ec1239f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "block-lab", - "version": "1.5.2", + "version": "1.5.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -8799,6 +8799,123 @@ } } }, + "husky": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.0.10.tgz", + "integrity": "sha512-Ptm4k2DqOwxeK/kzu5RaJmNRoGvESrgDXObFcZ8aJZcyXyMBHhM2FqZj6zYKdetadmP3wCwxEHCBuB9xGlRp8A==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "ci-info": "^2.0.0", + "cosmiconfig": "^6.0.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -11600,9 +11717,9 @@ } }, "node-sass": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz", - "integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==", + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz", + "integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -12277,6 +12394,12 @@ "mimic-fn": "^2.1.0" } }, + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true + }, "opener": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", @@ -12657,6 +12780,15 @@ "find-up": "^3.0.0" } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "plugin-error": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", @@ -14538,6 +14670,12 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, "semver-greatest-satisfied-range": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", @@ -17183,6 +17321,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", diff --git a/package.json b/package.json index 9e3276d89..218a13b7e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "block-lab", "title": "Block Lab", - "version": "1.5.2", + "version": "1.5.3", "description": "WordPress plugin with a simple templating system for building custom blocks.", "author": "Block Lab", "license": "GPL-2.0-or-later", @@ -51,10 +51,11 @@ "gulp": "^4.0.2", "gulp-run": "^1.7.1", "gulp-string-replace": "^1.1.2", + "husky": "^4.0.10", "jest-silent-reporter": "0.1.2", "merge-stream": "^2.0.0", "mini-css-extract-plugin": "0.8.2", - "node-sass": "^4.13.0", + "node-sass": "^4.13.1", "npm-run-all": "4.1.5", "postcss-loader": "^3.0.0", "raw-loader": "^4.0.0", @@ -77,6 +78,7 @@ "lint:pkg-json": "wp-scripts lint-pkg-json", "lint:php": "vendor/bin/phpcs", "lint:php:fix": "vendor/bin/phpcbf", + "precommit": "./bin/pre-commit.sh", "test:js": "wp-scripts test-unit-js --config=tests/js/jest.config.js" } }