Skip to content

Commit

Permalink
Merge pull request #116 from studiopress/update/analytics-and-copyright
Browse files Browse the repository at this point in the history
Don't instantiate unused analytics client
  • Loading branch information
kienstra authored Mar 23, 2022
2 parents a69ba3c + 5ed909d commit 82b6d1b
Show file tree
Hide file tree
Showing 50 changed files with 90 additions and 128 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ about: Report a problem
## Additional information

## Suspected cause (optional)
<!-- If you think you know what caused this bug -->

## Versions

Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--- Please summarize this PR in the title above -->

#### Changes
## Changes
*

#### Testing instructions
## Testing instructions
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Changelog ##

### 1.5.0 - Unreleased ###
### 1.5.0 - 2022-03-24 ###

* Allow previewing InnerBlocks in the block editor. [PR 114](https://github.com/studiopress/genesis-custom-blocks/pull/114)
* Allow opting in to analytics. [PR 101](https://github.com/studiopress/genesis-custom-blocks/pull/101)
Expand Down
24 changes: 12 additions & 12 deletions bin/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
# Lint staged PHP files
php_files=$( git diff --diff-filter=d --staged --name-only | grep -E '/*\.php$' )
if [ ! -z "$php_files" ]; then
npm run lint:php $php_files
if [ $? != 0 ]; then
exit 1
fi
npm run lint:php $php_files
if [ $? != 0 ]; then
exit 1
fi
fi

# Lint staged JS files
js_files=$( git diff --diff-filter=d --staged --name-only | grep -E '^js\/\S*\.js$' )
if [ ! -z "$js_files" ]; then
npm run lint:js:files $js_files
if [ $? != 0 ]; then
exit 1
fi
npm run lint:js:files $js_files
if [ $? != 0 ]; then
exit 1
fi
fi

# Lint staged .scss files
scss_files=$( git diff --diff-filter=d --staged --name-only | grep -E '/*\.scss$' )
if [ -n "$scss_files" ]; then
npm run lint:css:files $scss_files
if [ $? != 0 ]; then
exit 1
fi
npm run lint:css:files $scss_files
if [ $? != 0 ]; then
exit 1
fi
fi

# Lint package.json
Expand Down
8 changes: 4 additions & 4 deletions bin/tag-built.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ npm ci
npm run gulp
tag=$(grep 'Version:' package/trunk/genesis-custom-blocks.php | sed 's/.*: //' | sed 's/-[0-9]\{8\}T[0-9]\{6\}Z-[a-f0-9]*$//')
if [[ -z "$tag" ]]; then
echo "Error: Unable to determine tag."
exit 1
echo "Error: Unable to determine tag."
exit 1
fi

built_tag="$tag-built"
if git rev-parse "$built_tag" >/dev/null 2>&1; then
echo "Error: Built tag already exists: $built_tag"
exit 2
echo "Error: Built tag already exists: $built_tag"
exit 2
fi

git fetch origin --tags
Expand Down
2 changes: 1 addition & 1 deletion genesis-custom-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Genesis Custom Blocks
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*
* Plugin Name: Genesis Custom Blocks
Expand Down
58 changes: 30 additions & 28 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,37 @@ gulp.task( 'wporg:trunk', function() {
} );

gulp.task( 'clean:bundle', function() {
const trunkDir = 'package/trunk';

return del( [
'package/trunk/package',
'package/trunk/artifacts',
'package/trunk/assets/wporg',
'package/trunk/coverage',
'package/trunk/js/src',
'package/trunk/js/*.map',
'package/trunk/css/*.map',
'package/trunk/css/src',
'package/trunk/bin',
'package/trunk/built',
'package/trunk/node_modules',
'package/trunk/tests',
'package/trunk/trunk',
'package/trunk/gulpfile.js',
'package/trunk/Makefile',
'package/trunk/package*.json',
'package/trunk/phpunit.xml',
'package/trunk/phpcs.xml',
'package/trunk/postcss.config.js',
'package/trunk/tailwind.config.js',
'package/trunk/tsconfig.json',
'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/SHASUMS*',
`${ trunkDir }/package`,
`${ trunkDir }/artifacts`,
`${ trunkDir }/assets/wporg`,
`${ trunkDir }/coverage`,
`${ trunkDir }/js/src`,
`${ trunkDir }/js/*.map`,
`${ trunkDir }/css/*.map`,
`${ trunkDir }/css/src`,
`${ trunkDir }/bin`,
`${ trunkDir }/built`,
`${ trunkDir }/node_modules`,
`${ trunkDir }/tests`,
`${ trunkDir }/trunk`,
`${ trunkDir }/gulpfile.js`,
`${ trunkDir }/Makefile`,
`${ trunkDir }/package*.json`,
`${ trunkDir }/phpunit.xml`,
`${ trunkDir }/phpcs.xml`,
`${ trunkDir }/postcss.config.js`,
`${ trunkDir }/tailwind.config.js`,
`${ trunkDir }/tsconfig.json`,
`${ trunkDir }/README.md`,
`${ trunkDir }/CHANGELOG.md`,
`${ trunkDir }/CODE_OF_CONDUCT.md`,
`${ trunkDir }/CONTRIBUTING.md`,
`${ trunkDir }/webpack.config.js`,
`${ trunkDir }/.github`,
`${ trunkDir }/SHASUMS*`,
'package/prepare',
] );
} );
Expand Down
6 changes: 0 additions & 6 deletions js/src/block-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ import { setLocaleData } from '@wordpress/i18n';
*/
import { addControls, registerBlocks } from './helpers';
import { Edit } from './components';
import { GAClient } from '../common/classes';

setLocaleData( { '': {} }, 'genesis-custom-blocks' );
addFilter( 'genesisCustomBlocks.controls', 'genesisCustomBlocks/addControls', addControls );

// @ts-ignore
registerBlocks( genesisCustomBlocks, gcbBlocks, Edit );

// @ts-ignore
window.GcbAnalytics = {
GAClient: new GAClient(),
};
2 changes: 1 addition & 1 deletion js/src/edit-block/components/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { useField } from '../hooks';
* @property {import('./editor').Field} field The field to render.
* @property {number} index The index in relation to other fields, starting with 0.
* @property {boolean} isDownButtonDisabled Whether the down button is disabled.
* @property {import('./editor').SelectedField|import('../constants').NoFieldSelected} selectedField The currenetly selected field.
* @property {import('./editor').SelectedField|import('../constants').NoFieldSelected} selectedField The currently selected field.
* @property {boolean} shouldDisplayMoveButtons Whether this should display the move buttons.
* @property {import('./editor').SetIsNewField} setIsNewField Sets if there is a new field.
* @property {import('./editor').SetPanelDisplaying} setPanelDisplaying Sets the current panel displaying.
Expand Down
2 changes: 1 addition & 1 deletion php/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WP Admin resources.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Admin/Documentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Genesis Custom Blocks Documentation.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Admin/EditBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* The 'Edit Block' submenu page.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Admin/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Genesis Custom Blocks Importer.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Admin/Onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* User onboarding.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Genesis Custom Blocks Settings.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Admin/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Genesis Custom Blocks Upgrade Page.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/BlockApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Block API helper functions.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Block.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Radio control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Color control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/ControlAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Control abstract.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/ControlSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* ControlSetting.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Email control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* File control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Image control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/InnerBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* InnerBlocks control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Multiselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Select control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Number control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Radio.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Radio control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Range control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Select control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
2 changes: 1 addition & 1 deletion php/Blocks/Controls/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Text control.
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2021, Genesis Custom Blocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*/

Expand Down
Loading

0 comments on commit 82b6d1b

Please sign in to comment.